View Single Post
 
Old 02-11-2019, 03:37 AM
Ali Mubarak Ali Mubarak is offline Windows XP Office 2010
Novice
 
Join Date: Feb 2019
Posts: 6
Ali Mubarak is on a distinguished road
Default

Hi,


I attached the output of the macro,



I assumed as the following is the VB script to merge the "Tables".


Merging to Tables

Any of the previous examples can produce their output in a table format. All you need to do is to replace the heading & data lines in the field code with an equivalent table. When you do so, however, each record becomes a one-row table, as per the ‘Calculating Group and Sub-Group Totals’ example (page 14). To turn that output into one table per group you can run the following ‘TableJoiner’ macro after completing the merge.
Sub TableJoiner()
Application.ScreenUpdating = False
Dim oPara As Paragraph
For Each oPara In ActiveDocument.Paragraphs
With oPara.Range
If .Information(wdWithInTable) = True Then
With .Next
If .Information(wdWithInTable) = False Then
If .Text = vbCr Then .Delete
End If
End With
End If
End With
Next
Application.ScreenUpdating = True
End Sub




Regards,


Ali Mubarak
Attached Files
File Type: doc Mailmerge Main Document.doc (39.5 KB, 12 views)
File Type: docx Directory1.docx (17.2 KB, 12 views)
Reply With Quote