macro help

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
 
P

Pat Garard

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......
 
J

Jezebel

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top