Reply
 
Thread Tools Display Modes
  #1   Report Post  
Bobby
 
Posts: n/a
Default How do I add a macro to a document?

I want to add a macro:

Sub AutoOpen ()
Selection.Find.Execute Find Text:=MonmthNam
End Sub

What I wan this macro to DO is open my calendar on the current month, rather
than on January esch time. Purpose: to save scrolling down to every month
(except January) as the year progresses.

Can you help me?
  #2   Report Post  
Anne Troy
 
Posts: n/a
Default

Open your document. Hit Alt+F11 or Tools--Macro--Visual Basic Editor
(VBE). On the top-left, double-click ThisDocument under your document's
name. Type the following, instead of your code:

Private Sub Document_Open ()

Selection.Find.Execute Find Text:=MonmthNam

End Sub

Hit the SAVE diskette on the toolbar. Close the VBE.
*******************
~Anne Troy

www.OfficeArticles.com


"Bobby" wrote in message
...
I want to add a macro:

Sub AutoOpen ()
Selection.Find.Execute Find Text:=MonmthNam
End Sub

What I wan this macro to DO is open my calendar on the current month,

rather
than on January esch time. Purpose: to save scrolling down to every month
(except January) as the year progresses.

Can you help me?



Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
macro preventing document to be opened jimk Microsoft Word Help 5 July 14th 05 11:10 PM
Running a macro on a protected document. Kara Microsoft Word Help 1 April 26th 05 07:56 PM
mail merge with attachments AS Mailmerge 5 April 9th 05 09:49 AM
How to assign a macro to a shape in a word document? Frank Microsoft Word Help 1 February 25th 05 01:45 AM
2000 to 2002 macro and "Could not open macro storage" Art Farrell Mailmerge 1 December 6th 04 12:40 PM


All times are GMT +1. The time now is 07:22 PM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"