Access to publisher mail merge and save PDF as unique files...

iamrickdeans

New Member
Joined
Jan 10, 2014
Messages
2
I thank you all in advance for any help you can provide me, I am looking to perform a mail merge from access to Publisher. I have linked everything together and got everything looking the way that I want it to look however...
What I want to do is when I perform the mail merge I would like publisher to save a copy of each individual record from the database as a specific file based on one field of the mail merge.
I will try to clarify...
One of the mail merge fields is ClientAccountNumber I would like the merge to save a copy of the publisher file into c:\mailmerge as a PDF including the year 2014.
So this file(s)for example would look like
C:\mailmerge\123456 - 2014.pdf C:\mailmerge\123457 - 2014.pdf etc...
Does anyone know if this is possible and if so how I would go about it?
Regards
Richard
 

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
I have not trued this with Publisher but this is what I do with Word. I loop trough a recordset and for each record I preform the merge. I save it as a PDF and then move on tot he next record. Repeating the process for each record. By merging a single record at a time makes it very easy to save each into a separate PDF.
 
Upvote 0
Hi Boyd!

Thank you, so much for your reply your suggestion is what I am actually trying to do (I think)
I wrote the following code and my expectation was that the file would export as...

e.g C:\MailMerge\123456 - 2011.pdf

what actually happens is that it saves the file as

e.g FileNametemp - 2011.pdf


Now I am obviously not referencing the datasource in access correctly but I can't seem to work out how to do this, don't suppose you have any suggestions as you have managed it succesfully?

If it helps my db is located

L:\MailMerge\MailMerge.accdb

and the table I am wanting to link to is called '2011'

the field is named 'Box 22 Rcp Acct No'


Please find the code attached...

Any help is massively appreciated I have spent such a long time trying to work this out using bits and pieces of code from all over... This is as far as I have actually managed to get!


Code:
Sub MailMerge() 
 '
 ' Macro1 Macro

Dim TempDocCreate 
Dim FileNameTemp As MailMergeDataField 


Set FileNameTemp = Application.ActiveDocument.MailMerge.DataSource.DataFields.Item("Box 22 Rcp Acct No") 


With ActiveDocument.MailMerge.DataSource 
    Application.ActiveDocument.ExportAsFixedFormat pbFixedFormatTypePDF, Filename:= _ 
    "L:\Operations Database\Projects\1042\PublisherPDF\2011 Merge\" & "FileNameTemp" & " - 2011" & ".pdf" 


End With

This at least exports to the right location in the format that I want just doesn't have the correct file name!
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,886
Messages
6,175,196
Members
452,616
Latest member
intern444

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top