Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.
clutsa
in reply to: Maxim-CADman77

Would any of this info help you?

Sub Test()
Dim app As Application
Dim Doc As Document
Dim CompDef As ComponentDefinition
Dim PartType As String

Set app = ThisApplication
Set Doc = app.ActiveDocument
Set CompDef = Doc.ComponentDefinition
iPartFac = CompDef.IsiPartFactory
iPartMem = CompDef.IsiPartMember

Select Case Doc.DocumentType
Case Is = DocumentTypeEnum.kPartDocumentObject
    PartType = "Part File"
Case Is = DocumentTypeEnum.kDrawingDocumentObject
    PartType = "Drawing File"
'Case Is .... keep going with these
End Select

End Sub

Those may be easier then what you're doing. 

I know you'll have to have some error trapping but that should be a good start.

If I've helped you, please help me by supporting this idea.
Mass Override for Each Model State

Custom Glyph Icon for iMates