Message 1 of 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I don't normally program in VBA so maybe I've missed something obvious. This code should list all the documents and if it is a .IAM should add "IAM" to the start of the line and otherwise add "OTHER"
Public Sub ShowDocuments2() ' Get the Documents collection object. Dim invDocs As Documents Set invDocs = ThisApplication.Documents ' Iterate through the contents of the Documents collection. Dim invDocument As Document For Each invDocument In invDocs ' Display the full filename of the document in the Immediate window. Select Case invDocument.Type Case DocumentTypeEnum.kAssemblyDocumentObject Debug.Print "IAM " + invDocument.FullFileName Case Else Debug.Print "OTHER " + invDocument.FullFileName End Select Next End Sub
However the list I get is always "OTHER" even when the filename extension is "IAM", for example:
OTHER C:\Users\Owen\Documents\Inventor\Test_IAM.iam OTHER C:\Users\Owen\Documents\Inventor\DELME_T55_10T_6R_10N.IAM OTHER C:\Users\Owen\Documents\Inventor\DELME_T55_10T_6R_10N_CctNodi.ipt OTHER C:\Users\Owen\Documents\Inventor\Forcelle\30093895.ipt OTHER C:\Users\Owen\Documents\Inventor\Forcelle_2_Liscio.ipt OTHER C:\Users\Owen\Documents\Inventor\Cue_12\30091327.ipt
I would have expected the first two lines to start with "IAM" but they start with "OTHER".
Am I having a senior moment?
Solved! Go to Solution.