Loading/running modules with Word 2003

A

Azone

This is just a test I was fooling around with. It has to be a property of the
file or something. I can't figure out how to get this sub to run once the
file is open. Any Suggestions????

Code:
Sub nameTest()
Dim fName As String
Dim lName As String
Dim fullName As String
Dim strMsg1 As String

fName = InputBox("What is your first name?", "First Name")
lName = InputBox("What is your last name?", "Last Name")
fullName = MsgBox("Is this your full name?: " & fName & " " & lName,
vbYesNo, "Full Name")

Do While fullName <> vbYes
fName = InputBox("What is your first name?", "First Name")
lName = InputBox("What is your last name?", "Last Name")
fullName = MsgBox("Is this your full name?: " & fName & " " &
lName, vbYesNo, "Full Name")
Loop

strMsg1 = MsgBox("Thanks for your confirmation!", vbOKOnly, "Thanks!!")
End Sub
 
D

Doug Robbins - Word MVP

If you want it to run when an existing file is opened, then it needs to be
called Autoopen(). If you want it to run when a new file is created, it
needs to be called Autonew()

--
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
 

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