views:

545

answers:

1

Hello,

I am trying to have some code fire when the document is first loaded, but there are two problems. First, I don't know which method to call to get something to fire when the document is first opened. Second, if they have macros disabled, how can I be sure that it gets called when they are enabled?

Thanks!

+2  A: 

The Document_Open event is sent when your document is first loaded. To make use of it, enter the following in the VBA code for ThisDocument:

Private Sub Document_Open()

    '// your code goes here'

End Sub

As for the disabled macros, I'm not aware of a method that will be called as soon as macros are enabled.

e.James
Thanks, that should help!As for the disabled macro's I will figure something out I suppose.
Seamus