Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 03-07-2017, 03:06 PM
macropod's Avatar
macropod macropod is offline Legal Caption needs a way to dynamically create right-paren separator Windows 7 64bit Legal Caption needs a way to dynamically create right-paren separator Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,467
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
 

Tags
legal pleadings



Similar Threads
Thread Thread Starter Forum Replies Last Post
Legal Caption needs a way to dynamically create right-paren separator Automatically Organize data in a sheet differently (in order to create a dynamically updated graph) carlos_cs Excel 3 05-04-2016 08:44 AM
Auto add a right paren at end of line dlowrey Word 2 10-07-2014 07:10 AM
Combining two pieces of VBA to create caption field above table lsmcal1984 Word VBA 1 08-16-2013 04:12 AM
Legal Caption needs a way to dynamically create right-paren separator Dynamically create documents MrRikkie Word VBA 1 10-12-2012 09:15 AM
Add automatic separator in caption "Figure 1: __" poobear Word 1 05-12-2011 04:05 PM

Other Forums: Access Forums

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