[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 752
  • Last Modified:

Word VBA-Autoexec macro

Using NT 4.0 and Office 97.  Tried to develop a macro as outlined in an excellent book.  Used the VBEditor, input the lines of code and it was supposed to ask who I am when I restarted Word.  Obviously, didn't happen.  Made the update to the Normal.dot.  What am I missing?  Thank you for helping me learn this.  
0
BegnrSteve
Asked:
BegnrSteve
  • 4
  • 4
1 Solution
 
BegnrSteveAuthor Commented:
Edited text of question.
0
 
blakeh1Commented:
was the macro placed in the Normal.dots open event or is it called auto_open?
0
 
NickRackhamCommented:
Is this loaded as a global template?

Use the AutoNew to ensure it runs when ever you open a new doc.
0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
BegnrSteveAuthor Commented:
Well, I am more lost now than I was.  Here is the code I was to input in the Normal.dot as the global template each time Word 97 executes.

Public CurrentUser As String
Sub AutoExec()
  CurrentUser=InputBox("Please enter  your name.", "Current User Identity")

End Sub

Sub Identify_Current_User()
  MsgBox "The current user is " + CurrentUser, vbOKOnly + vbInformation, "Current User"

End Sub

I put the Public Current User in the General Declarations area and, of course, the subroutines separated out as I started each routine.  The author of the book directs me to save and then close Word8.0 and then reopen Word.  These macros should run upon opening a blank document.  

How do I set the Auto_Open property on the Normal.dot?  I like that idea.  And, how do I access and update the AutoNew?  I like that idea, too.  Thank you for responding to my lack of knowledge.

v/r
BegnrSteve
0
 
NickRackhamCommented:
create a new macro called AutoNew then copy your code into the new macro. Save it in Normal.Dot.

It should now run when a new doc is created.

Nick
0
 
BegnrSteveAuthor Commented:
Thanks.  This will definitely work.  You deserve more points than I proposed.  Have a Happy New Year!
0
 
NickRackhamCommented:
No Problem, Getting points is rewarding but so is "Thanks"

Happy New Year to you too.

Nick
0
 
BegnrSteveAuthor Commented:
Nick,

Got back to work today from the dear old flu--tried your suggestion and it worked as advertised.  Thanks, again.

Steve
0
 
NickRackhamCommented:
No problem, Hope you're feeling better?

Nick
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 4
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now