AfterActiveDocumentChange Event

I am trying to handle the AfterActiveDocumentChange event and getting error

"AddHandler Statement Event Operand must be a dot-qualified expression or a simple name".



Private oApp As SolidEdgeFramework.Application

Private oAppEvents As SolidEdgeFramework.ISEApplicationEvents

Private oDoc As SolidEdgeFramework.SolidEdgeDocument


Sub Main()

oApp = DirectCast(Marshal.GetActiveObject("SolidEdge.Appl​ication"), SolidEdgeFramework.Application)

oDoc = DirectCast(oApp.ActiveDocument, SolidEdgeFramework.SolidEdgeDocument)

oAppEvents = CType(oApp.ApplicationEvents, SolidEdgeFramework.ISEApplicationEvents_Event)


AddHandler oAppEvents.AfterActiveDocumentChange(oDoc), AddressOf oApp_AfterActiveDocumentChange

End Sub


Private Sub oApp_AfterActiveDocumentChange(ByVal theDocument As Object)


End Sub


If I remove the argument oDoc in the AddHandler line, I get an error

"AfterActiveDocumentChange is not an event of SolidEdgeFramework.ISEApplicationEvents"


Has anyone seen this error before ?

Any help is highly appreciated.





Re: AfterActiveDocumentChange Event

You cross posted so I'll only reply once in the orignal blog post.

Jason Newell
Applications Architect

Re: AfterActiveDocumentChange Event

Yes, I did.

Thanks Jason  that was a silly overlook.