Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #3  
Old 03-08-2017, 08:39 AM
gilly1 gilly1 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 2007
Novice
Legal Caption needs a way to dynamically create right-paren separator
 
Join Date: Mar 2017
Posts: 2
gilly1 is on a distinguished road
Default

This is awesome! Thanks.
I ran into an error on the last iteration of the for loop where it could not find a table and would hang so I put in a conditional. I'm also testing gmayor's MMToDocs outbound to PDFCreator and saw that I could call this macro just before splitting the documents vs. doing the merging within this macro. Here's the adjusted code to use with MMToDocs.

Code:
Sub MailMergeToDoc(aDoc As Document)
Dim Sctn As Section, sngHght As Single
'Commented Out -- ActiveDocument.MailMerge.Execute
For Each Sctn In aDoc.Sections
  If Sctn.Range.Tables.Count > 0 Then
    With Sctn.Range.Tables(1)
    .Cell(1, 2).Range.Characters.Last.Previous.Select
      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
  End If
Next
End Sub
Thanks again!
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 08:21 AM.


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