Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #15  
Old 02-06-2019, 02:56 AM
Kalü Kalü is offline Start MailMerge for 3 different Word documents in Excel depending on value in column A Windows 10 Start MailMerge for 3 different Word documents in Excel depending on value in column A Office 2010 32bit
Advanced Beginner
Start MailMerge for 3 different Word documents in Excel depending on value in column A
 
Join Date: Apr 2018
Posts: 43
Kalü is on a distinguished road
Default

Quote:
Originally Posted by macropod View Post
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.
It works for a few docs but then comes the popup: do you want to save changes you made to letters9?, I say Save and then it wants to save it as Error.docx. In the document itself stands: Error! Not a valid filename.
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Start MailMerge for 3 different Word documents in Excel depending on value in column A Mailmerge Excel with a Master Word Template (via VBA) stevenel Excel Programming 8 08-14-2018 03:05 PM
Start MailMerge for 3 different Word documents in Excel depending on value in column A Rounding Up or Down depending on Start & End time richardst Excel 4 06-21-2016 06:03 PM
Marking specific cells depending on start and end time entered ellebb85 Excel Programming 0 01-17-2016 02:50 AM
Start MailMerge for 3 different Word documents in Excel depending on value in column A documents saved with double column revert to single column when re-opened danw Word 6 04-08-2015 06:24 AM
Merge Word documents using a mailmerge field Concertina Mail Merge 3 02-18-2013 04:12 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 09:36 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