Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / March 2006

Tip: Looking for answers? Try searching our database.

Loading/running modules with Word 2003

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Azone - 15 Mar 2006 20:10 GMT
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

Signature

"True warrior triumph in battle within  the mind before striking their
enemies on the battle field."

-Azone

Doug Robbins - Word MVP - 15 Mar 2006 20:24 GMT
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()

Signature

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

> This is just a test I was fooling around with. It has to be a property of
> the
[quoted text clipped - 22 lines]
>    strMsg1 = MsgBox("Thanks for your confirmation!", vbOKOnly, "Thanks!!")
> End Sub
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.