Opening a user form

S

Stanley

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 can't 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
 
F

Fumei2 via OfficeKB.com

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 also have it in a private directory (not the template directory)."
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).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top