Ask for name on open & update field

P

Pete

How do I create a prompt box on document opening for a Word user to enter
their name and for this entry to be displayed in... a form field (for
example). Thanks in advance for any help! :)
 
G

Graham Mayor

Create an autoopen macro in the document or its template (not the normal
template)

Sub Autoopen
Dim sName as String
sName = InputBox("Enter your name")
ActiveDocument.formfields("Text1").Result = sName
End If

will put the result in form field Text1

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
P

Pete

Thanks Graham, I got it to work. I had to use Legacy form field and I also
had to remove "End If"

All the best
 
G

Graham Mayor

Sorry for the typo It should have been End Sub :(
--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
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

Similar Threads


Top