Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 05-13-2013, 02:23 PM
DaddyMac DaddyMac is offline Mailmerge Individual Documents Windows 7 32bit Mailmerge Individual Documents Office 2010 32bit
Novice
Mailmerge Individual Documents
 
Join Date: May 2013
Posts: 3
DaddyMac is on a distinguished road
Default Mailmerge Individual Documents

Hello!



I created a brief script which allows me to save the preview results of single mail merge record (Word 2010) directly to .pdf without having to complete the actual merge to a new file. It uses a filename based on a bookmark ("UniqueName") of several merge fields. This allows me to save the result with a filename from the results of the merge fields (note: I must toggle to preview results prior to executing the macro or I'll just wind up with a filename based on the merge field names, not the results).

Since bookmarks don't "survive" the merge process, I'm wondering whether I can accomplish the same thing for multiple records...? Would it be possible to do a variation of Socrates01's code to have it cycle through each mail merge preview record and save it as a .pdf? So, if I had 5 or 500 mail merge preview records, could I fire a macro that would peel them all off individually and save them each to a .pdf, each with their unique filename from the preview results?

Here is what I use to do this with one record at a time*:

Code:
Sub PREVIEW2PDFfromBookmark()
    Dim UniqueFileName As String
    UniqueFileName = ActiveDocument.Bookmarks("UniqueName").Range.Text
    ActiveDocument.SaveAs2 FileName:="S:\FOLDER\" & UniqueFileName & ".pdf", FileFormat:=wdFormatPDF
End Sub
Any advice or guidance will be greatly appreciated!

Thanks!

*oddly, this macro won't run from my custom ribbon button; I have to select the macro via the Developer tab to get the macro to execute and save the file.

Last edited by macropod; 05-13-2013 at 04:05 PM. Reason: Split from old thread & added code tags & formatting
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Individual numbers for pages ewintrs Word 1 03-16-2013 12:46 PM
Merge Word documents using a mailmerge field Concertina Mail Merge 3 02-18-2013 04:12 AM
Mailmerge Individual Documents Mailmerge to Email with a mailmerge attachment Baldeagle Mail Merge 8 02-11-2013 04:40 AM
Individual Pop Up Alerts vbmike73 Outlook 0 10-18-2012 06:33 AM
Mailmerge Individual Documents Mailmerge to Email with a mailmerge attachment Baldeagle Mail Merge 13 05-29-2012 02:04 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 01:22 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft