Before the procedures will run, however, you must connect the declared object in the class module with the Document object.
- In the Code window for your main module, add the following line to the declarations section:
Dim X As New EventClassModule
- In the same window, add the following subroutine:
Sub InitializeEvents() Set X.Doc = ThisDrawing End Sub
- In the code for your main module, add a call to the InitializeApp subroutine:
Call InitializeEvents
Once the InitializeEvents procedure has been run, the Doc object in the class module points to the Document object created, and any event procedures in the class module will run when the events occur.