Thread: [Solved] Need a macro adjustment
View Single Post
 
Old 12-07-2021, 01:16 PM
Ulodesk Ulodesk is offline Windows 10 Office 2016
Word 2013 Expert Cert
 
Join Date: Sep 2009
Location: Virginia
Posts: 866
Ulodesk is on a distinguished road
Default Need a macro adjustment

Hi. I have this macro from previous assistance. I am working on a document now with tons of tables that is set up differently. I need the tables -- even better would two specific table styles, which are N-Table1 and N-Table2 -- to be:
left-aligned,
indented 0.3 inches, and
7.2" wide

Code:
Sub TablesResizeAll()
'
' Resizes all tables in document to 6.5" wide, centered
'
    Dim oTbl As Table
    For Each oTbl In ActiveDocument.Tables
        oTbl.AutoFitBehavior wdAutoFitFixed
        With ActiveDocument.PageSetup
            oTbl.PreferredWidth = .PageWidth - .LeftMargin - .RightMargin
            oTbl.Rows.Alignment = wdAlignRowCenter
        End With
    Next oTbl
End Sub
Many thanks!
Reply With Quote