View Single Post
 
Old 03-07-2017, 03:06 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

What you could do, without the need for a separate column in your table, is use the mergefield \f switch to output the ')' for each populated line. That wouldn't help with lines that wrap, though, and there's no way for a mailmerge to generate the ')' in such cases. The alternative would be to use a macro to populate the column with ')' characters post-merge. The following macro will both execute the merge and update the output document post-merge.
Code:
Sub MailMergeToDoc()
Dim Sctn As Section, sngHght As Single
ActiveDocument.MailMerge.Execute
For Each Sctn In ActiveDocument.Sections
  With Sctn.Range.Tables(1)
    sngHght = .Cell(1, 1).Range.Characters.Last.Previous.Information(wdVerticalPositionRelativeToPage)
    With .Cell(1, 2).Range
      .Text = "))))"
      Do While .Characters.Last.Previous.Information(wdVerticalPositionRelativeToPage) < sngHght
        .Characters.Last.InsertBefore ")"
      Loop
    End With
  End With
Next
End Sub
For PC macro installation & usage instructions, see: http://www.gmayor.com/installing_macro.htm
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote