Word - Opening a user form

Asked By Stanley on 01-Jun-10 11:53 AM
I am using the following code to open a user form when I open a Word 2003
document.
Private Sub Document_New()
UserForm1.Show
End Sub
For some reason I cannot get the user form to show.
I have this code in a template and I am opening the document from it. I also
have it in a private directory (not the template directory).
Thanks,
Stanley


Fumei2 via OfficeKB.com replied to Stanley on 01-Jun-10 07:20 PM
That does not make the userform show on document open.

Sub Document_Open()
UserForm1.Show
End Sub

If you have the code (Document_NEW) in the template, then when the template
is used to make a NEW document, the userform will display.

I have no idea what you mean by that.

In any case, if you want a document to display a userform on document open,
then you must have the show instruction in a Document_Open procedure in the
ThisDocument code module of the document (not the template).


--
Gerry

Message posted via http://www.officekb.com