Thread: [Solved] Need a macro adjustment
View Single Post
 
Old 12-09-2021, 03:38 PM
Guessed's Avatar
Guessed Guessed is offline Windows 10 Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 3,978
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

Does this one solve the allow autofit issue?
Code:
Sub TablesResizeAll()
  Dim oTbl As Table
  For Each oTbl In ActiveDocument.Tables
    If Not oTbl.Rows.WrapAroundText Then
      oTbl.AllowAutoFit = False
      oTbl.AutoFitBehavior wdAutoFitFixed
      oTbl.PreferredWidthType = wdPreferredWidthPoints
      oTbl.PreferredWidth = InchesToPoints(7.2)
      oTbl.Rows.Alignment = wdAlignRowLeft
      oTbl.Rows.LeftIndent = InchesToPoints(0.3)
    End If
  Next oTbl
End Sub
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote