Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / January 2006

Tip: Looking for answers? Try searching our database.

Automating PDF printing during mail merge

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Nuraq - 02 Jan 2006 13:05 GMT
I am using Word 2003 and Acrobat 6.  I want to automate a procedure that
runs a mail merge and prints each record to a PDF file using VB.

My problem is that I want to supply the file name to the Acrobat printer so
that it soes not prompt me for it.  Is there a way to do this in VB?
Doug Robbins - Word MVP - 02 Jan 2006 16:21 GMT
If you go to fellow MVP Graham Mayor's website at:

http://www.gmayor.com/individual_merge_letters.htm

and download a copy of the add-in that I wrote to allow the execution of a
mailmerge to a separate document for each record with the filename of each
document being provided from one of the fields in the datasource, and if you
modfy the following line of code in the Private Sub
app_MailMergeAfterMerge(ByVal Doc As Document, ByVal DocResult As Document)
routing in the MergeApplication Class Module

from:

           NewDoc.SaveAs FldrPath & fnames(i)
           NewDoc.Close

to:

           NewDoc.SaveAs FldrPath & fnames(i)
           NewDoc.PrintOut Background: = False
           NewDoc.Close wdDoNotSaveChanges

Then, before executing the merge to a new document, you select Print from
the File menu and select "Adobe PDF" as the printer and then you click on
the Properties tab and uncheck the "View Adobe PDF results" and "Prompt for
Adobe PDF filename" items and then close that dialog.

Now, execute your mailmerge to a new document and click on "Yes" when you
are asked if you want to create separate files for each document, and then
select the field in the datasource that will supply the filenames, then when
you click on Continue, as well as having the files saved in the directory
that you had nominated, a .pdf will be created in the MyDocuments folder
with the name of the .pdf being supplied from the datasource.

I have just made this modification to the add-in myself and it worked fine.
Signature

Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

>I am using Word 2003 and Acrobat 6.  I want to automate a procedure that
>runs a mail merge and prints each record to a PDF file using VB.
>
> My problem is that I want to supply the file name to the Acrobat printer
> so that it soes not prompt me for it.  Is there a way to do this in VB?
Tom Winter - 04 Jan 2006 14:32 GMT
This article may help you out:

http://www.suodenjoki.dk/us/productions/articles/word2pdf.htm

Tom Winter
tom@nospam.amosfivesix.com

>I am using Word 2003 and Acrobat 6.  I want to automate a procedure that
>runs a mail merge and prints each record to a PDF file using VB.
>
> My problem is that I want to supply the file name to the Acrobat printer
> so that it soes not prompt me for it.  Is there a way to do this in VB?
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.