Newbie trying to Programmatically mail merge from Access to Publis

Q

qbutler

Forgive me if this is the wrong forum, I am a newbie. I have an access
database that contains the mege data that I would like to use in publisher.
I have created a form in Access with a button that on execute I would like to
use Office Automation and open my Publisher Template and merge the data
fields. From access I have included the reference to the Publisher object.
I can include the code that I have so far but I am not even sure I am on the
right path. Haven't been able to find any examples on programmatically doing
publisher's mail merge. Any help or push in the right direction is
appreciated.
 
E

Ed Bennett

qbutler said:
Thanks, I will start with this and see if I can transfer the same logic into
access. I want to be able to complet the mail merge from withing access with
a button on a form and let it open up Publisher throught automation.

This is relatively simple to do. You need to set a reference to the
Publisher object library, and then create a new instance of Publisher with:

Dim pApp As New Publisher.Application.

Then instead of using ThisDocument, either create or open a document and
assign it an object.

Dim aDoc As New Publisher.Document
Set aDoc = pApp.Open(...)

(The syntax for the .Open method is documented in the Publisher Object
Model Help; available on MSDN or by pressing F1 in Publisher's VBA IDE.)
 

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