Hi,
I am using the below code to format a table in a word document by selecting each column and removing the indenting from each column.
However when I run the code for the first instance the below code works fine but from the second time table does not get formatted as desired. Indenting is not removed as per the below code.
Also the table I m trying to format using the below code is the last table in the document.
Please help.
wdrange.Tables(1).Select
wdrange.Tables(1).Columns(1).SetWidth ColumnWidth:=20, RulerStyle:=wdAdjustNone
wdrange.Tables(1).Columns(2).SetWidth ColumnWidth:=260, RulerStyle:=wdAdjustNone
wdrange.Tables(1).Columns(3).SetWidth ColumnWidth:=30, RulerStyle:=wdAdjustNone
wdrange.Tables(1).Columns(4).SetWidth ColumnWidth:=60, RulerStyle:=wdAdjustNone
wdrange.Tables(1).Columns(1).Select
wdrange.ParagraphFormat.Space1
With wdrange.ParagraphFormat
.LeftIndent = InchesToPoints(0)
.RightIndent = InchesToPoints(0)
.SpaceBefore = 5
.SpaceBeforeAuto = True
.SpaceAfter = 5
.SpaceAfterAuto = True
.LineSpacingRule = wdLineSpaceSingle
.Alignment = wdAlignParagraphCenter
.WidowControl = True
.KeepWithNext = False
.KeepTogether = False
.PageBreakBefore = False
.NoLineNumber = False
.Hyphenation = True
.FirstLineIndent = InchesToPoints(0)
.OutlineLevel = wdOutlineLevelBodyText
.CharacterUnitLeftIndent = 0
.CharacterUnitRightIndent = 0
.CharacterUnitFirstLineIndent = 0
.LineUnitBefore = 0
.LineUnitAfter = 0
.MirrorIndents = False
.TextboxTightWrap = wdTightNone
End With
Thanks
Bookmarks