access to perform a catalog merge with publisher

J

Juan

Hello, I am trying to write a code to open a file in
publisher, perform a catalog merge, and save the
Publisher file from Microsoft Access. So far I have
tried to modify the code from Microsoft Knowledge Base
Article 159328 but I have yet to succeed.

I can perform the catalog merge manually by opening the
publisher file, selecting the data source from access,
and creating the merge. Is there any place where I can
get clarification on how to write the code necessary for
automating the two programs????

Function MergeIt()
Dim objPub As Publisher.Document
Set objPub = GetObject
("C:\database\findmeTemplate2.pub", "Publisher.Document")
' Make Publisher visible.
' objPub.Application.Visible = True
' Set the mail merge data source
objPub.MailMerge.OpenDataSource _
Name:="C:\database\FindMe.pub"
'At this point, Name causes a compiling error

LinkToSource:=True, _
Connection:="TABLE ScholarshipDonors", _
SQLStatement:="Select * from
[ScholarshipDonors]"
' Execute the mail merge.
' And the execute method also causes an error.
objPub.MailMerge.Execute
End Function
 

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