Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Mail Merge

Status
Not open for further replies.

mike718

Programmer
Jul 7, 2004
58
US
I have written a vba macro that seperates a letter mail merge and saves each letter into its own document. My macro runs after the merge is complete. Once the merge is completed my macro breaks up the file and saves each letter as a single word document. What I would like to do is pull one field form the document so that I can save the split documents by a specific name. My question is after a merge is complete can I pull certain field values from a page and if so how?
 
As far as I know, the documents generated by a merge do not have identifiable fields - each place where there is a field in the template just contains a text value (specified by the data source) in the generated docs.

You may have to resort to something creative to pull this off. For instance, if you're not using the header (or footer), you could put a duplicate of the desired merge field in there, then go to page setup and set the headers "distance from top" setting to 0 and the pages' top margin to a normal printable value (usually at least .5 inch). That way the header would not print, but you could still read the header from code and do your thing with the value that's in it.



VBAjedi [swords]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top