Forum Discussion
Hakana
Mar 28, 2026Copper Contributor
Word VBA, Unreachable table style setting?
I've noticed something that may be a missing feature in the Word VBA Object model. Styles in word can be of different kinds set by the WdStyleType when adding a style via expression.Add (Name, Type)...
Charles_Kenyon
Apr 04, 2026Bronze Contributor
I do not know that this will help, but here is a sample that I recorded when creating a new Table Style following John Korchok's directions on my Tables page.
Table Styles Complete by John Korchok
Sub StyleTableStyleCreate()
'
' StyleTableStyleCreate Macro
'
'
ActiveDocument.Styles.Add Name:="Table Style Custom Grid 1", Type:= _
wdStyleTypeTable
With ActiveDocument.Styles("Table Style Custom Grid 1").Font
.Name = "+Body"
.Size = 11
.Bold = False
.Italic = False
.Underline = wdUnderlineNone
.UnderlineColor = wdColorAutomatic
.StrikeThrough = False
.DoubleStrikeThrough = False
.Outline = False
.Emboss = False
.Shadow = False
.Hidden = False
.SmallCaps = False
.AllCaps = False
.Color = wdColorAutomatic
.Engrave = False
.Superscript = False
.Subscript = False
.Scaling = 100
.Kerning = 0
.Animation = wdAnimationNone
.Ligatures = wdLigaturesStandardContextual
.NumberSpacing = wdNumberSpacingDefault
.NumberForm = wdNumberFormDefault
.StylisticSet = wdStylisticSetDefault
.ContextualAlternates = 0
End With
With ActiveDocument.Styles("Table Style Custom Grid 1").ParagraphFormat
.LeftIndent = InchesToPoints(0)
.RightIndent = InchesToPoints(0)
.SpaceBefore = 0
.SpaceBeforeAuto = False
.SpaceAfter = 0
.SpaceAfterAuto = False
.LineSpacingRule = wdLineSpaceSingle
.Alignment = wdAlignParagraphLeft
.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
.CollapsedByDefault = False
End With
ActiveDocument.Styles("Table Style Custom Grid 1"). _
NoSpaceBetweenParagraphsOfSameStyle = False
ActiveDocument.Styles("Table Style Custom Grid 1").ParagraphFormat. _
TabStops.ClearAll
ActiveDocument.Styles("Table Style Custom Grid 1").Frame.Delete
With ActiveDocument.Styles("Table Style Custom Grid 1").Table
.TableDirection = 1
.TopPadding = InchesToPoints(0)
.BottomPadding = InchesToPoints(0)
.LeftPadding = InchesToPoints(0.08)
.RightPadding = InchesToPoints(0.08)
.Alignment = wdAlignRowLeft
.Spacing = 0
.AllowPageBreaks = True
.AllowBreakAcrossPage = True
.LeftIndent = InchesToPoints(0)
.RowStripe = 1
.ColumnStripe = 1
End With
With ActiveDocument.Styles("Table Style Custom Grid 1").Table
With .Shading
.Texture = wdTextureNone
.ForegroundPatternColor = wdColorAutomatic
.BackgroundPatternColor = wdColorAutomatic
End With
With .Borders(wdBorderLeft)
.LineStyle = wdLineStyleSingle
.LineWidth = wdLineWidth050pt
.Color = -603914241
End With
With .Borders(wdBorderRight)
.LineStyle = wdLineStyleSingle
.LineWidth = wdLineWidth050pt
.Color = -603914241
End With
With .Borders(wdBorderTop)
.LineStyle = wdLineStyleSingle
.LineWidth = wdLineWidth050pt
.Color = -603914241
End With
With .Borders(wdBorderBottom)
.LineStyle = wdLineStyleSingle
.LineWidth = wdLineWidth050pt
.Color = -603914241
End With
With .Borders(wdBorderHorizontal)
.LineStyle = wdLineStyleSingle
.LineWidth = wdLineWidth050pt
.Color = -603914241
End With
With .Borders(wdBorderVertical)
.LineStyle = wdLineStyleSingle
.LineWidth = wdLineWidth050pt
.Color = -603914241
End With
.Borders.Shadow = False
End With
With ActiveDocument.Styles("Table Style Custom Grid 1").Table.Condition( _
wdFirstRow)
.TopPadding = InchesToPoints(0)
.BottomPadding = InchesToPoints(0)
.LeftPadding = InchesToPoints(0.08)
.RightPadding = InchesToPoints(0.08)
End With
With ActiveDocument.Styles("Table Style Custom Grid 1").Table.Condition( _
wdFirstRow)
With .Shading
.Texture = wdTextureNone
.ForegroundPatternColor = wdColorAutomatic
.BackgroundPatternColor = -704577537
End With
With .Borders(wdBorderLeft)
.LineStyle = wdLineStyleSingle
.LineWidth = wdLineWidth050pt
.Color = -603914241
End With
With .Borders(wdBorderRight)
.LineStyle = wdLineStyleSingle
.LineWidth = wdLineWidth050pt
.Color = -603914241
End With
With .Borders(wdBorderTop)
.LineStyle = wdLineStyleSingle
.LineWidth = wdLineWidth050pt
.Color = -603914241
End With
.Borders(wdBorderBottom).LineStyle = wdLineStyleNone
.Borders.Shadow = False
End With
With ActiveDocument.Styles("Table Style Custom Grid 1").Table.Condition( _
wdFirstRow).ParagraphFormat
.LeftIndent = InchesToPoints(0)
.RightIndent = InchesToPoints(0)
.SpaceBefore = 0
.SpaceBeforeAuto = False
.SpaceAfter = 0
.SpaceAfterAuto = False
.LineSpacingRule = wdLineSpaceSingle
.Alignment = wdAlignParagraphLeft
.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
.CollapsedByDefault = False
End With
ActiveDocument.Styles("Table Style Custom Grid 1"). _
NoSpaceBetweenParagraphsOfSameStyle = False
With ActiveDocument.Styles("Table Style Custom Grid 1").Table.Condition( _
wdFirstRow).Font
.Name = ""
.Bold = True
.Color = -603914241
End With
ActiveDocument.Styles("Table Style Custom Grid 1").Table.Condition( _
wdFirstRow).ParagraphFormat.TabStops.ClearAll
With ActiveDocument.Styles("Table Style Custom Grid 1").Table.Condition( _
wdLastRow)
.TopPadding = InchesToPoints(0)
.BottomPadding = InchesToPoints(0)
.LeftPadding = InchesToPoints(0.08)
.RightPadding = InchesToPoints(0.08)
End With
With ActiveDocument.Styles("Table Style Custom Grid 1").Table.Condition( _
wdLastRow)
With .Shading
.Texture = wdTextureNone
.ForegroundPatternColor = wdColorAutomatic
.BackgroundPatternColor = -704577537
End With
With .Borders(wdBorderLeft)
.LineStyle = wdLineStyleSingle
.LineWidth = wdLineWidth050pt
.Color = -603914241
End With
With .Borders(wdBorderRight)
.LineStyle = wdLineStyleSingle
.LineWidth = wdLineWidth050pt
.Color = -603914241
End With
.Borders(wdBorderTop).LineStyle = wdLineStyleNone
With .Borders(wdBorderBottom)
.LineStyle = wdLineStyleSingle
.LineWidth = wdLineWidth050pt
.Color = -603914241
End With
.Borders.Shadow = False
End With
With ActiveDocument.Styles("Table Style Custom Grid 1").Table.Condition( _
wdLastRow).ParagraphFormat
.LeftIndent = InchesToPoints(0)
.RightIndent = InchesToPoints(0)
.SpaceBefore = 0
.SpaceBeforeAuto = False
.SpaceAfter = 0
.SpaceAfterAuto = False
.LineSpacingRule = wdLineSpaceSingle
.Alignment = wdAlignParagraphLeft
.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
.CollapsedByDefault = False
End With
ActiveDocument.Styles("Table Style Custom Grid 1"). _
NoSpaceBetweenParagraphsOfSameStyle = False
With ActiveDocument.Styles("Table Style Custom Grid 1").Table.Condition( _
wdLastRow).Font
.Name = ""
.Bold = True
.Color = -603914241
End With
ActiveDocument.Styles("Table Style Custom Grid 1").Table.Condition( _
wdLastRow).ParagraphFormat.TabStops.ClearAll
With ActiveDocument.Styles("Table Style Custom Grid 1").Table.Condition( _
wdFirstColumn)
.TopPadding = InchesToPoints(0)
.BottomPadding = InchesToPoints(0)
.LeftPadding = InchesToPoints(0.08)
.RightPadding = InchesToPoints(0.08)
End With
With ActiveDocument.Styles("Table Style Custom Grid 1").Table.Condition( _
wdFirstColumn)
With .Shading
.Texture = wdTextureNone
.ForegroundPatternColor = wdColorAutomatic
.BackgroundPatternColor = -704577537
End With
With .Borders(wdBorderLeft)
.LineStyle = wdLineStyleSingle
.LineWidth = wdLineWidth050pt
.Color = -603914241
End With
.Borders(wdBorderRight).LineStyle = wdLineStyleNone
With .Borders(wdBorderTop)
.LineStyle = wdLineStyleSingle
.LineWidth = wdLineWidth050pt
.Color = -603914241
End With
With .Borders(wdBorderBottom)
.LineStyle = wdLineStyleSingle
.LineWidth = wdLineWidth050pt
.Color = -603914241
End With
.Borders.Shadow = False
End With
With ActiveDocument.Styles("Table Style Custom Grid 1").Table.Condition( _
wdFirstColumn).ParagraphFormat
.LeftIndent = InchesToPoints(0)
.RightIndent = InchesToPoints(0)
.SpaceBefore = 0
.SpaceBeforeAuto = False
.SpaceAfter = 0
.SpaceAfterAuto = False
.LineSpacingRule = wdLineSpaceSingle
.Alignment = wdAlignParagraphLeft
.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
.CollapsedByDefault = False
End With
ActiveDocument.Styles("Table Style Custom Grid 1"). _
NoSpaceBetweenParagraphsOfSameStyle = False
With ActiveDocument.Styles("Table Style Custom Grid 1").Table.Condition( _
wdFirstColumn).Font
.Name = ""
.Bold = True
.Color = -603914241
End With
ActiveDocument.Styles("Table Style Custom Grid 1").Table.Condition( _
wdFirstColumn).ParagraphFormat.TabStops.ClearAll
With ActiveDocument.Styles("Table Style Custom Grid 1").Table.Condition( _
wdLastColumn)
.TopPadding = InchesToPoints(0)
.BottomPadding = InchesToPoints(0)
.LeftPadding = InchesToPoints(0.08)
.RightPadding = InchesToPoints(0.08)
End With
With ActiveDocument.Styles("Table Style Custom Grid 1").Table.Condition( _
wdLastColumn)
With .Shading
.Texture = wdTextureNone
.ForegroundPatternColor = wdColorAutomatic
.BackgroundPatternColor = -704577537
End With
.Borders(wdBorderLeft).LineStyle = wdLineStyleNone
With .Borders(wdBorderRight)
.LineStyle = wdLineStyleSingle
.LineWidth = wdLineWidth050pt
.Color = -603914241
End With
With .Borders(wdBorderTop)
.LineStyle = wdLineStyleSingle
.LineWidth = wdLineWidth050pt
.Color = -603914241
End With
With .Borders(wdBorderBottom)
.LineStyle = wdLineStyleSingle
.LineWidth = wdLineWidth050pt
.Color = -603914241
End With
.Borders.Shadow = False
End With
With ActiveDocument.Styles("Table Style Custom Grid 1").Table.Condition( _
wdLastColumn).ParagraphFormat
.LeftIndent = InchesToPoints(0)
.RightIndent = InchesToPoints(0)
.SpaceBefore = 0
.SpaceBeforeAuto = False
.SpaceAfter = 0
.SpaceAfterAuto = False
.LineSpacingRule = wdLineSpaceSingle
.Alignment = wdAlignParagraphLeft
.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
.CollapsedByDefault = False
End With
ActiveDocument.Styles("Table Style Custom Grid 1"). _
NoSpaceBetweenParagraphsOfSameStyle = False
With ActiveDocument.Styles("Table Style Custom Grid 1").Table.Condition( _
wdLastColumn).Font
.Name = ""
.Bold = True
.Color = -603914241
End With
ActiveDocument.Styles("Table Style Custom Grid 1").Table.Condition( _
wdLastColumn).ParagraphFormat.TabStops.ClearAll
With ActiveDocument.Styles("Table Style Custom Grid 1").Table.Condition( _
wdOddColumnBanding)
.TopPadding = InchesToPoints(0)
.BottomPadding = InchesToPoints(0)
.LeftPadding = InchesToPoints(0.08)
.RightPadding = InchesToPoints(0.08)
End With
With ActiveDocument.Styles("Table Style Custom Grid 1").Table.Condition( _
wdOddColumnBanding)
With .Shading
.Texture = wdTextureNone
.ForegroundPatternColor = wdColorAutomatic
.BackgroundPatternColor = -704577690
End With
.Borders(wdBorderLeft).LineStyle = wdLineStyleNone
.Borders(wdBorderRight).LineStyle = wdLineStyleNone
.Borders(wdBorderTop).LineStyle = wdLineStyleNone
.Borders(wdBorderBottom).LineStyle = wdLineStyleNone
.Borders.Shadow = False
End With
With ActiveDocument.Styles("Table Style Custom Grid 1").Table.Condition( _
wdOddColumnBanding).ParagraphFormat
.LeftIndent = InchesToPoints(0)
.RightIndent = InchesToPoints(0)
.SpaceBefore = 0
.SpaceBeforeAuto = False
.SpaceAfter = 0
.SpaceAfterAuto = False
.LineSpacingRule = wdLineSpaceSingle
.Alignment = wdAlignParagraphLeft
.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
.CollapsedByDefault = False
End With
ActiveDocument.Styles("Table Style Custom Grid 1"). _
NoSpaceBetweenParagraphsOfSameStyle = False
ActiveDocument.Styles("Table Style Custom Grid 1").Table.Condition( _
wdOddColumnBanding).Font.Name = ""
ActiveDocument.Styles("Table Style Custom Grid 1").Table.Condition( _
wdOddColumnBanding).ParagraphFormat.TabStops.ClearAll
With ActiveDocument.Styles("Table Style Custom Grid 1").Table.Condition( _
wdEvenColumnBanding)
.TopPadding = InchesToPoints(0)
.BottomPadding = InchesToPoints(0)
.LeftPadding = InchesToPoints(0.08)
.RightPadding = InchesToPoints(0.08)
End With
With ActiveDocument.Styles("Table Style Custom Grid 1").Table.Condition( _
wdEvenColumnBanding)
With .Shading
.Texture = wdTextureNone
.ForegroundPatternColor = wdColorAutomatic
.BackgroundPatternColor = -704577741
End With
.Borders(wdBorderLeft).LineStyle = wdLineStyleNone
.Borders(wdBorderRight).LineStyle = wdLineStyleNone
.Borders(wdBorderTop).LineStyle = wdLineStyleNone
.Borders(wdBorderBottom).LineStyle = wdLineStyleNone
.Borders.Shadow = False
End With
With ActiveDocument.Styles("Table Style Custom Grid 1").Table.Condition( _
wdEvenColumnBanding).ParagraphFormat
.LeftIndent = InchesToPoints(0)
.RightIndent = InchesToPoints(0)
.SpaceBefore = 0
.SpaceBeforeAuto = False
.SpaceAfter = 0
.SpaceAfterAuto = False
.LineSpacingRule = wdLineSpaceSingle
.Alignment = wdAlignParagraphLeft
.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
.CollapsedByDefault = False
End With
ActiveDocument.Styles("Table Style Custom Grid 1"). _
NoSpaceBetweenParagraphsOfSameStyle = False
ActiveDocument.Styles("Table Style Custom Grid 1").Table.Condition( _
wdEvenColumnBanding).Font.Name = ""
ActiveDocument.Styles("Table Style Custom Grid 1").Table.Condition( _
wdEvenColumnBanding).ParagraphFormat.TabStops.ClearAll
With ActiveDocument.Styles("Table Style Custom Grid 1").Table.Condition( _
wdOddRowBanding)
.TopPadding = InchesToPoints(0)
.BottomPadding = InchesToPoints(0)
.LeftPadding = InchesToPoints(0.08)
.RightPadding = InchesToPoints(0.08)
End With
With ActiveDocument.Styles("Table Style Custom Grid 1").Table.Condition( _
wdOddRowBanding)
With .Shading
.Texture = wdTextureNone
.ForegroundPatternColor = wdColorAutomatic
.BackgroundPatternColor = -704577690
End With
.Borders(wdBorderLeft).LineStyle = wdLineStyleNone
.Borders(wdBorderRight).LineStyle = wdLineStyleNone
.Borders(wdBorderTop).LineStyle = wdLineStyleNone
.Borders(wdBorderBottom).LineStyle = wdLineStyleNone
.Borders(wdBorderVertical).LineStyle = wdLineStyleNone
.Borders.Shadow = False
End With
With ActiveDocument.Styles("Table Style Custom Grid 1").Table.Condition( _
wdOddRowBanding).ParagraphFormat
.LeftIndent = InchesToPoints(0)
.RightIndent = InchesToPoints(0)
.SpaceBefore = 0
.SpaceBeforeAuto = False
.SpaceAfter = 0
.SpaceAfterAuto = False
.LineSpacingRule = wdLineSpaceSingle
.Alignment = wdAlignParagraphLeft
.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
.CollapsedByDefault = False
End With
ActiveDocument.Styles("Table Style Custom Grid 1"). _
NoSpaceBetweenParagraphsOfSameStyle = False
ActiveDocument.Styles("Table Style Custom Grid 1").Table.Condition( _
wdOddRowBanding).Font.Name = ""
ActiveDocument.Styles("Table Style Custom Grid 1").Table.Condition( _
wdOddRowBanding).ParagraphFormat.TabStops.ClearAll
With ActiveDocument.Styles("Table Style Custom Grid 1").Table.Condition( _
wdEvenRowBanding)
.TopPadding = InchesToPoints(0)
.BottomPadding = InchesToPoints(0)
.LeftPadding = InchesToPoints(0.08)
.RightPadding = InchesToPoints(0.08)
End With
With ActiveDocument.Styles("Table Style Custom Grid 1").Table.Condition( _
wdEvenRowBanding)
With .Shading
.Texture = wdTextureNone
.ForegroundPatternColor = wdColorAutomatic
.BackgroundPatternColor = -704577741
End With
.Borders(wdBorderLeft).LineStyle = wdLineStyleNone
.Borders(wdBorderRight).LineStyle = wdLineStyleNone
.Borders(wdBorderTop).LineStyle = wdLineStyleNone
.Borders(wdBorderBottom).LineStyle = wdLineStyleNone
.Borders(wdBorderVertical).LineStyle = wdLineStyleNone
.Borders.Shadow = False
End With
With ActiveDocument.Styles("Table Style Custom Grid 1").Table.Condition( _
wdEvenRowBanding).ParagraphFormat
.LeftIndent = InchesToPoints(0)
.RightIndent = InchesToPoints(0)
.SpaceBefore = 0
.SpaceBeforeAuto = False
.SpaceAfter = 0
.SpaceAfterAuto = False
.LineSpacingRule = wdLineSpaceSingle
.Alignment = wdAlignParagraphLeft
.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
.CollapsedByDefault = False
End With
ActiveDocument.Styles("Table Style Custom Grid 1"). _
NoSpaceBetweenParagraphsOfSameStyle = False
ActiveDocument.Styles("Table Style Custom Grid 1").Table.Condition( _
wdEvenRowBanding).Font.Name = ""
ActiveDocument.Styles("Table Style Custom Grid 1").Table.Condition( _
wdEvenRowBanding).ParagraphFormat.TabStops.ClearAll
With ActiveDocument.Styles("Table Style Custom Grid 1").Table.Condition( _
wdNECell)
.TopPadding = InchesToPoints(0)
.BottomPadding = InchesToPoints(0)
.LeftPadding = InchesToPoints(0.08)
.RightPadding = InchesToPoints(0.08)
End With
With ActiveDocument.Styles("Table Style Custom Grid 1").Table.Condition( _
wdNECell)
With .Shading
.Texture = wdTextureNone
.ForegroundPatternColor = wdColorAutomatic
.BackgroundPatternColor = -704577741
End With
.Borders(wdBorderLeft).LineStyle = wdLineStyleNone
.Borders(wdBorderRight).LineStyle = wdLineStyleNone
.Borders(wdBorderTop).LineStyle = wdLineStyleNone
.Borders(wdBorderBottom).LineStyle = wdLineStyleNone
.Borders.Shadow = False
End With
With ActiveDocument.Styles("Table Style Custom Grid 1").Table.Condition( _
wdNECell).ParagraphFormat
.LeftIndent = InchesToPoints(0)
.RightIndent = InchesToPoints(0)
.SpaceBefore = 0
.SpaceBeforeAuto = False
.SpaceAfter = 0
.SpaceAfterAuto = False
.LineSpacingRule = wdLineSpaceSingle
.Alignment = wdAlignParagraphLeft
.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
.CollapsedByDefault = False
End With
ActiveDocument.Styles("Table Style Custom Grid 1"). _
NoSpaceBetweenParagraphsOfSameStyle = False
ActiveDocument.Styles("Table Style Custom Grid 1").Table.Condition( _
wdNECell).Font.Name = ""
ActiveDocument.Styles("Table Style Custom Grid 1").Table.Condition( _
wdNECell).ParagraphFormat.TabStops.ClearAll
With ActiveDocument.Styles("Table Style Custom Grid 1").Table.Condition( _
wdNWCell)
.TopPadding = InchesToPoints(0)
.BottomPadding = InchesToPoints(0)
.LeftPadding = InchesToPoints(0.08)
.RightPadding = InchesToPoints(0.08)
End With
With ActiveDocument.Styles("Table Style Custom Grid 1").Table.Condition( _
wdNWCell)
With .Shading
.Texture = wdTextureNone
.ForegroundPatternColor = wdColorAutomatic
.BackgroundPatternColor = -704577741
End With
.Borders(wdBorderLeft).LineStyle = wdLineStyleNone
.Borders(wdBorderRight).LineStyle = wdLineStyleNone
.Borders(wdBorderTop).LineStyle = wdLineStyleNone
.Borders(wdBorderBottom).LineStyle = wdLineStyleNone
.Borders.Shadow = False
End With
With ActiveDocument.Styles("Table Style Custom Grid 1").Table.Condition( _
wdNWCell).ParagraphFormat
.LeftIndent = InchesToPoints(0)
.RightIndent = InchesToPoints(0)
.SpaceBefore = 0
.SpaceBeforeAuto = False
.SpaceAfter = 0
.SpaceAfterAuto = False
.LineSpacingRule = wdLineSpaceSingle
.Alignment = wdAlignParagraphLeft
.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
.CollapsedByDefault = False
End With
ActiveDocument.Styles("Table Style Custom Grid 1"). _
NoSpaceBetweenParagraphsOfSameStyle = False
ActiveDocument.Styles("Table Style Custom Grid 1").Table.Condition( _
wdNWCell).Font.Name = ""
ActiveDocument.Styles("Table Style Custom Grid 1").Table.Condition( _
wdNWCell).ParagraphFormat.TabStops.ClearAll
With ActiveDocument.Styles("Table Style Custom Grid 1").Table.Condition( _
wdSECell)
.TopPadding = InchesToPoints(0)
.BottomPadding = InchesToPoints(0)
.LeftPadding = InchesToPoints(0.08)
.RightPadding = InchesToPoints(0.08)
End With
With ActiveDocument.Styles("Table Style Custom Grid 1").Table.Condition( _
wdSECell)
With .Shading
.Texture = wdTextureNone
.ForegroundPatternColor = wdColorAutomatic
.BackgroundPatternColor = -704577741
End With
.Borders(wdBorderLeft).LineStyle = wdLineStyleNone
.Borders(wdBorderRight).LineStyle = wdLineStyleNone
.Borders(wdBorderTop).LineStyle = wdLineStyleNone
.Borders(wdBorderBottom).LineStyle = wdLineStyleNone
.Borders.Shadow = False
End With
With ActiveDocument.Styles("Table Style Custom Grid 1").Table.Condition( _
wdSECell).ParagraphFormat
.LeftIndent = InchesToPoints(0)
.RightIndent = InchesToPoints(0)
.SpaceBefore = 0
.SpaceBeforeAuto = False
.SpaceAfter = 0
.SpaceAfterAuto = False
.LineSpacingRule = wdLineSpaceSingle
.Alignment = wdAlignParagraphLeft
.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
.CollapsedByDefault = False
End With
ActiveDocument.Styles("Table Style Custom Grid 1"). _
NoSpaceBetweenParagraphsOfSameStyle = False
ActiveDocument.Styles("Table Style Custom Grid 1").Table.Condition( _
wdSECell).Font.Name = ""
ActiveDocument.Styles("Table Style Custom Grid 1").Table.Condition( _
wdSECell).ParagraphFormat.TabStops.ClearAll
With ActiveDocument.Styles("Table Style Custom Grid 1").Table.Condition( _
wdSWCell)
.TopPadding = InchesToPoints(0)
.BottomPadding = InchesToPoints(0)
.LeftPadding = InchesToPoints(0.08)
.RightPadding = InchesToPoints(0.08)
End With
With ActiveDocument.Styles("Table Style Custom Grid 1").Table.Condition( _
wdSWCell)
With .Shading
.Texture = wdTextureNone
.ForegroundPatternColor = wdColorAutomatic
.BackgroundPatternColor = -704577741
End With
.Borders(wdBorderLeft).LineStyle = wdLineStyleNone
.Borders(wdBorderRight).LineStyle = wdLineStyleNone
.Borders(wdBorderTop).LineStyle = wdLineStyleNone
.Borders(wdBorderBottom).LineStyle = wdLineStyleNone
.Borders.Shadow = False
End With
With ActiveDocument.Styles("Table Style Custom Grid 1").Table.Condition( _
wdSWCell).ParagraphFormat
.LeftIndent = InchesToPoints(0)
.RightIndent = InchesToPoints(0)
.SpaceBefore = 0
.SpaceBeforeAuto = False
.SpaceAfter = 0
.SpaceAfterAuto = False
.LineSpacingRule = wdLineSpaceSingle
.Alignment = wdAlignParagraphLeft
.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
.CollapsedByDefault = False
End With
ActiveDocument.Styles("Table Style Custom Grid 1"). _
NoSpaceBetweenParagraphsOfSameStyle = False
ActiveDocument.Styles("Table Style Custom Grid 1").Table.Condition( _
wdSWCell).Font.Name = ""
ActiveDocument.Styles("Table Style Custom Grid 1").Table.Condition( _
wdSWCell).ParagraphFormat.TabStops.ClearAll
End SubDoes that address the attributes you want to change?
See the links in my previous reply.
Hakana
Apr 07, 2026Copper Contributor
Aye, as cdrgreg noted. The setting I'm looking for is not recorded. (I tried the record macro earlier as well to see if there was a hidden Property or method that I had missed).
I've posted a workaround further down.