PDA

View Full Version : Prompt for Form ASKs on document open



gstettner
02-09-2007, 10:19 PM
I have created a Word 2000 template with several ASK prompts, the results of which are later REFerenced in the document. I cannot, however, seem to get the prompts to go off when the template is opened.

I have tried using the VBA coding noted in at least one post here (see below). That post says to append ".show" to the userform, but I don't think my form has a name. In addition, I have tried to use the Word help "Create macro to automatically display ASK fields," but that doesn't work either.

Use the Document_Open event.

1. open the VBE (Alt-F11)
2. if Project Explorer is not visible, press Ctl-R.
3. navigate to the document in question. It is shows as something like: (Project mydoc.doc).
4. if the ThisDocument module is not visible, expand the project by clicking the little plus sign
5. double click the ThisDocument module to open it.
6. from the LEFT dropdown (at the top of the code module window), select Document. This will automatically write a blank Document_New procedure. You can delete this.
7. with Document showing in the LEFT dropdown, click the RIGHT dropdown, and select Open. This will automatically write a blank Document_Open procedure.
8. put in the code to .Show the userform. Like this:

:banghead:

mdmackillop
02-10-2007, 04:29 AM
Hi gstettner,
Welcome to VBAX
A couple of points.
Have you created a specific userform? (Within the VBE Insert/Userform)
Check your macro security is not set to High.

Here's a simple userform example with the Userform code
Private Sub Document_Open()
UserForm1.Show
End Sub


If you're not using a userfom, can you remove sensitive data and post your document? You can do this by zipping it and attaching using Manage Attachments in the Go Advanced section.