macro help

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
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......
 
Back
Top