I'm not sure if you want to print the document name or the actual model document.
To get the model name (from a drawing) the code is as follows:
Public Sub GetDrawingModelName() ' Get reference to the first referenced document Dim oDoc As Document Set oDoc = ThisApplication.ActiveDocument.ReferencedDocuments
.Item(1) ' Get file system object Dim Fso As New FileSystemObject Debug.Print Fso.GetFileName(oDoc.FullFileName) ' Change Debug.Print to be a msgbox or any variable if you want End Sub
If you want to print the actual document let me know an i'll write up something for you.
thanks for your quick reply. It's just what I need.
Be aware that drawing documents can have many separate documents driving difference drawing views.
Offset 1 is just the first view the user created. It may not be the primary document you desire.
I am getting iPropeties from ipt file and table it on the drawing.I'll check there is only one ipt file referenced.
Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register
Start with some of our most frequented solutions to get help installing your software.