I have a macro that resizes all tables in a document to margin width, but it doesn't center them, which is also part of our style. I have tried to find the right code in VBA, starting a line with oTbl. and seeing what optins come up, but it's pure trial and error -- and all errors. There doesn't seem to be a horizontal alignment tag... Here's what I have:
Code:
Sub ResizeAllTables()
Dim oTbl As Table
For Each oTbl In ActiveDocument.Tables
oTbl.AutoFitBehavior wdAutoFitFixed
With ActiveDocument.PageSetup
oTbl.PreferredWidth = .PageWidth - .LeftMargin - .RightMargin
End With
Next oTbl
End Sub