Load document after start-up form

T

thomas.b.mann

New to VBA in Word.

I have a simple form that I want to pop up when the user opens a
document. When the user does something there and clicks a 'submit'
button I want the document to open. Simple right?

So far I have:

In module AutoExec:

Sub Main()
Load UserForm1
UserForm1.Show
End Sub


In the click event for a button on UserForm1 I have this (for
simplicity let's assume the button does nothing else but I just want
to proceed with opening the document):

Private Sub btnSubmit_Click()
Me.Hide
ThisDocument.Activate
End Sub

This is apparently not correct. I have tried a few other things such
as:

Load ThisDocument
Unload Me

This must be something simple. Any help?
 
S

Shauna Kelly

Hi Thomas

Before we can help, we need some more information:
- do you want this form to show when a user opens *any* document, or just
specific documents?
- do you want this form to show when a user creates a new document? If so,
does it apply to every new document, or just some?

And, what version of Word are you using?

Hope this helps.

Shauna Kelly. Microsoft MVP.
http://www.shaunakelly.com/word
 

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