Private m_ApplicationEvents As Inventor.ApplicationEvents
Public Sub Activate(ByVal addInSiteObject As Inventor.ApplicationAddInSite, _
ByVal firstTime As Boolean) _
Implements Inventor.ApplicationAddInServer.Activate
m_inventorApplication = addInSiteObject.Application
m_ApplicationEvents = m_inventorApplication.ApplicationEvents
AddHandler m_ApplicationEvents.OnOpenDocument, _
AddressOf Me.m_ApplicationEvents_OnOpenDocument
End Sub
Private Sub m_ApplicationEvents_OnOpenDocument( _
ByVal DocumentObject As Inventor._Document, _
ByVal FullDocumentName As String, _
ByVal BeforeOrAfter As Inventor.EventTimingEnum, _
ByVal Context As Inventor.NameValueMap, _
ByRef HandlingCode As Inventor.HandlingCodeEnum)
System.Windows.Forms.MessageBox.Show(_
"OnOpenDocument: " + DocumentObject.DisplayName)
End Sub