Visualbasic userform to appear automatically

D

donna

I have managed to create a word document and the user form behind it to ask
and populate questions.

What i am having trouble with is when i send the document to someone else
the userform does not appear for them to input the answers to the prompts.

Any ideas.
 
F

Fumei2 via OfficeKB.com

Version please.

Essentially, you need to have a procedure to Show the userform. If you want
it to Show on opening the document, you need to have that instruction in the
Document_Open event. This is in the ThisDocument code module.

Sub Document_Open()
Userform1.Show
End Sub

Now when the document is opened, the userform will display.

Caveat:

The userform MUST be in the document VBProject. If it is in a template then
it will NOT be in the document.
 
D

Doug Robbins - Word MVP

A macro needs to be run to show the user form. If the form is in a
template, the name of the macro would be AutoNew() so that when the user
created a file from the template by using File>New and then selected the
template, the macro would automatically run.

If what you are sending is actually a document that the you intent the user
to just open, the macro would be named AutoOpen(), BUT, there are a number
of issues. If the users Macro Security Level is set to High, the macro will
not run and the user will get no indication that it is being disabled. If
the level is set to the Medium Level (Disable macros with notification), the
user will be asked if they want to enable the macros in the document and the
macro will only run if they do enable them.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP, originally posted via msnews.microsoft.com
 
G

Graham Mayor

Undoubtedly you have saved the macros related to the user form in a template
that the remote user does not have access to. Move the macros and userform to
the document template and send the template. - see
http://www.gmayor.com/installing_macro.htm
--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 

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