I'm writing a macro in word, which is an adjustment to the Normal.dot, adding an extra stage to the print events handler to prevent certain documents from being printed on unsecured printers.
Inside the ThisDocument Object is the following code:
This correctly initialises the Events module if you open Word from a saved document, but doesn't initialise if I open Word from the start menu until I create a new document2.
i.e.
I open Word from the start menu, which opens a new Document1 by default, the events handler doesn't trigger.
I open another new document, Document2, which initialises the events handler, it then works perfectly from here.
Does anyone know how to force initialisation on the first opening? It has to be automatic, not a user initiated step.
On a related note, does anyone know how to apply these changes to multiple copies of Word without overwriting the normal.dot file, or copying the macro into every normal.dot?
Thanks!
EllieCat
Inside the ThisDocument Object is the following code:
Code:
Dim X As New EventClassModule
Private Sub Document_New()
Set X.App = Word.Application
End Sub
Private Sub Document_Open()
Set X.App = Word.Application
End Sub
This correctly initialises the Events module if you open Word from a saved document, but doesn't initialise if I open Word from the start menu until I create a new document2.
i.e.
I open Word from the start menu, which opens a new Document1 by default, the events handler doesn't trigger.
I open another new document, Document2, which initialises the events handler, it then works perfectly from here.
Does anyone know how to force initialisation on the first opening? It has to be automatic, not a user initiated step.
On a related note, does anyone know how to apply these changes to multiple copies of Word without overwriting the normal.dot file, or copying the macro into every normal.dot?
Thanks!
EllieCat