#1   Report Post  
tzap_1998
 
Posts: n/a
Default macro help

I am confused. I have a document that contains a macro to perform a
mailmerge. The macro is called send_news. I want the macro to execute
everytime the document which is called news letter is opened. I have tried
using the macro switch in the run dialog box . Do i put the path name in for
word or for the document. I am using word xp and office xp. Any help would
be apreciated.
The news letter document is in the my documents folder.

Thanks
  #2   Report Post  
Pat Garard
 
Posts: n/a
Default

G'Day Tzap 1998,

You do not tell us your version of Word.

Open the document.

ALT+F11 to get the VBA editor.

Upper left "Project Explorer" - locate "ThisDocument" in the
hierarchy for the open document AND double-click it.

You will see a "Code Window" for ThisDocument.

Upper Left dropdown - select "Document",

Upper Right dropdown - select "Open",

insert the name of your Macro:

Private Sub Document_New()
send_news 'Here OR ...
End Sub

Private Sub Document_Open()
send_news '...here
End Sub

Use:
Sub Document_Open() for a document, OR
Sub Document_New() in a Template......
--
Regards,
Pat Garard
Australia
_______________________

"tzap_1998" wrote in message
...
I am confused. I have a document that contains a macro to perform a
mailmerge. The macro is called send_news. I want the macro to execute
everytime the document which is called news letter is opened. I have tried
using the macro switch in the run dialog box . Do i put the path name in
for
word or for the document. I am using word xp and office xp. Any help
would
be apreciated.
The news letter document is in the my documents folder.

Thanks



  #3   Report Post  
Jezebel
 
Posts: n/a
Default

Rename the macro AutoOpen (if the macro is attached to the document or its
template).




"tzap_1998" wrote in message
...
I am confused. I have a document that contains a macro to perform a
mailmerge. The macro is called send_news. I want the macro to execute
everytime the document which is called news letter is opened. I have tried
using the macro switch in the run dialog box . Do i put the path name in

for
word or for the document. I am using word xp and office xp. Any help

would
be apreciated.
The news letter document is in the my documents folder.

Thanks



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 in Word John Microsoft Word Help 1 December 9th 04 02:22 PM
macro won't go away David Emerling Microsoft Word Help 2 December 2nd 04 09:20 PM
Word 2003 - create a macro with a pause in it. Katie Smith Microsoft Word Help 1 December 1st 04 10:30 PM
Should be simple! Macro to find italics won't run LizW Microsoft Word Help 2 November 30th 04 07:32 PM
How to set a macro to insert a second page into a template A. Richardson Microsoft Word Help 5 November 30th 04 11:31 AM


All times are GMT +1. The time now is 09:52 AM.

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"