![]() |
|
#4
|
||||
|
||||
|
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
__________________
Graham Mayor - MS MVP (Word) (2002-2019) Visit my web site for more programming tips and ready made processes www.gmayor.com |
| Tags |
| mailmerge |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
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 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 |