Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #4  
Old 04-25-2024, 03:23 AM
gmayor's Avatar
gmayor gmayor is offline Excel to Word - Many to One Mail Merge - Help! Windows 10 Excel to Word - Many to One Mail Merge - Help! Office 2019
Expert
 
Join Date: Aug 2014
Posts: 4,144
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

Another way would be to employ Merge Many To One

This entails a small modification to the merge document (attached) and a macro (below) run from the add-in to place the check boxes. The result is in the result document example (attached). Sort the data on the customer field(attached) and that is the key field and filename field. The rest of the fields are child fields..

Code:
Sub AddChecks(oDoc As Document)
Dim oTable As Table
Dim oRng As Range
Dim i As Long, j As Long
    Set oTable = oDoc.Tables(1)
    On Error Resume Next
    For i = 2 To oTable.Rows.Count
        For j = 6 To 7
        Set oRng = oTable.Cell(i, j).Range
            oRng.End = oRng.End - 1
            oDoc.ContentControls.Add wdContentControlCheckBox, oRng
        Next j
    Next i
End Sub
Attached Files
File Type: docx Sample Letter.docx (37.7 KB, 8 views)
File Type: xlsx Mail Merge Data.xlsx (73.6 KB, 6 views)
File Type: docx Result.docx (30.8 KB, 10 views)
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote
 

Tags
mailmerge



Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel to Word - Many to One Mail Merge - Help! Mail Merge - Create seperate Mail merge pdf for each sheets of an excel file sureshbvs Word VBA 1 03-12-2021 05:42 AM
Excel to Word Using Mail Merge Jacqueline Mail Merge 1 10-07-2020 04:12 AM
Excel to Word - Many to One Mail Merge - Help! Excel to Word Table via Mail Merge ged147 Mail Merge 4 11-28-2018 02:52 AM
Update & Unlink Specific Merge Field in Word Doc from Mail Merge - Excel VBA RMerckling Mail Merge 16 05-17-2018 05:19 PM
Help with switches: Word mail merge with Excel ks_ Mail Merge 0 12-09-2009 05:09 PM

Other Forums: Access Forums

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