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?
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
> New to VBA in Word.
>
[quoted text clipped - 27 lines]
>
> This must be something simple. Any help?