View Single Post
 
Old 02-27-2018, 05:45 PM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,956
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

You can't retrieve a mergefield name from the output document. In any event, it would be more efficient to generate the individual output files as part of the merge process rather than doing it afterwards. For code to do that (and name the output files according to field names in the data source), see Send Mailmerge Output to Individual Files in the Mailmerge Tips and Tricks 'Sticky' thread at the top of the mailmerge forum:
https://www.msofficeforums.com/mail-...ps-tricks.html

If you're wedded to the existing process, see Split Merged Output to Separate Documents in the same thread for pointers on how you might retrieve the desired filenames.

PS: When posting code, please use the code tags, indicated by the # button on the posting menu. Without them, your code loses much of whatever structure it had.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote