Automate Mail Merge using MS SQL VIEW in a Word Mail Merge Templat

A

Alpha

Hi,
I've created a Word 2000 template as a Mail Merge to print mailing labels. I've specified the Datasource to be a MS SQL2000 View (sincie it won't take stored procedure). When I double click on the template it opens up and creates a new document but it doesn't automatically merge the datasource. I have manually click on the Merge icon for it to merge. Can someone show me what VBA code I need to have the Merge automatically done when the dcoment is opened and created.
Thanks,
Alpha
 
D

Doug Robbins - Word MVP

With ActiveDocument.MailMerge
.Destination = wdSendToNewDocument
.Execute
End With


--
Please post any further questions or followup to the newsgroups for the
benefit of others who may be interested. Unsolicited questions forwarded
directly to me will only be answered on a paid consulting basis.

Hope this helps
Doug Robbins - Word MVP
Alpha said:
Hi,
I've created a Word 2000 template as a Mail Merge to print mailing labels.
I've specified the Datasource to be a MS SQL2000 View (sincie it won't take
stored procedure). When I double click on the template it opens up and
creates a new document but it doesn't automatically merge the datasource. I
have manually click on the Merge icon for it to merge. Can someone show me
what VBA code I need to have the Merge automatically done when the dcoment
is opened and created.
 

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