Message 1 of 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello,
I'm trying to run the rule below upon opening a document. But whenever I open a document, the rule runs twice. How do I make this sub routine only run once within the document being opened?
Private Sub m_ApplicationEvents_OnOpenDocument() Handles m_ApplicationEvents.OnOpenDocument
Dim oDoc As Inventor.Document = ThisApplication.ActiveDocument
Select Case True
Case oDoc.DocumentType = Inventor.DocumentTypeEnum.kPartDocumentObject
MsgBox("Open: I am a Part | " & oDoc.DisplayName)
Case oDoc.DocumentType = Inventor.DocumentTypeEnum.kAssemblyDocumentObject
MsgBox("Open: I am a Assembly | " & oDoc.DisplayName)
Case oDoc.DocumentType = Inventor.DocumentTypeEnum.kDrawingDocumentObject
MsgBox("Open: I am a Drawing | " & oDoc.DisplayName)
End Select
End Sub
Solved! Go to Solution.