Automate MailMerge in Publisher

K

Kumar Thiagarajan

I am trying to auomate the mail merge in Publisher 2003. I am using a comma
delimited text file with 2 columns and the first row as header. The pub file
has 2 merge fields.

Dim a As New Publisher.Application

a.Open ("c:\publication1.pub")
a.ActiveWindow.Visible = True
a.ActiveWindow.Activate
a.ActiveWindow.WindowState = pbWindowStateMaximize

'How do you set up the datasource - specify that its a comma delimited
text file
'with the first row as header
'a.ActiveDocument.MailMerge.DataSource.Type = ?
a.ActiveDocument.MailMerge.OpenDataSource ("c:\testdata.txt")
'After this line executes I see the pbu document with "«Missing merge
field»"

a.ActiveDocument.MailMerge.Execute (False)

Is there a way to automate emailing this merged publisher document based on
the values from one of the columns?

Thanks for all the help,
Kumar
 

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