View Single Post
 
Old 02-05-2019, 02:18 PM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
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

Once you've done the Word referencing in the Excel workbook, there is no need for anyone else to do so - the referencing travels with the workbook.

Here's an approach for handling your three letters that allows you to keep each in its own document and still have just a single document for your mailmerge:
1. Save each of your existing mailmerge main documents as ordinary Word documents, naming them sb1.docx, sb2.docx, & sb3.docx, respectively (as you originally indicated them to be).
2. Create a new mailmerge main document.
3. Use just the following field code in your new mailmerge main document:
{SKIPIF{MERGEFIELD Anz}= "0"}{QUOTE{INCLUDETEXT "{FILENAME \p}\..\sb{MERGEFIELD Anz}.docx"}}
4. Save your new mailmerge main document in the same folder as your three letters.
5. Reference only your new mailmerge main document in the VBA code.

Note: with the above there should be no need for your 'where (Anz>0)' in the SQL statement.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote