View Single Post
 
Old 03-27-2021, 06:33 PM
Cendrinne's Avatar
Cendrinne Cendrinne is offline Windows 10 Office 2019
Competent Performer
 
Join Date: Aug 2019
Location: Montreal Quebec Canada
Posts: 190
Cendrinne is on a distinguished road
Default Need Help to Script to align all the tables only as of a section to end of doc?

Hello Word VBA pros,

I'm trying to script to have all tables, as of the active Section, (so this point forward), to have all tables with a LeftIndent of 0.38 InchesToPoints.

This is what I've came up with, but it doesn't work.

Need help to fix it up, Please

HTML Code:
 Application.ScreenUpdating = False
    Dim aTbl As Table
    Dim oSec As Section
    Dim oRng As range
    
    For Each aTbl In ActiveDocument.Tables
      Set oRng = oSec.range

       aTbl.Rows.Alignment = wdAlignRowLeft
       aTbl.Rows.LeftIndent = InchesToPoints(0.38)
       aTbl.Rows.WrapAroundText = False
  Next aTbl
  
Application.ScreenUpdating = True
  On Error GoTo 0
Any help, would be greatly appreciated.

Thanks again,

Cendrinne

Last edited by Cendrinne; 03-27-2021 at 08:41 PM.
Reply With Quote