Class TableStyle (Word VBA)

The class TableStyle represents a single style that can be applied to a table.

Set

To use a TableStyle class variable it first needs to be instantiated, for example

Dim tblsty as TableStyle
Set tblsty = ActiveDocument.Range.TableStyle

The following procedures can be used to set variables of type TableStyle: Range.TableStyle and Style.Table

Properties

Alignment returns or sets a WdRowAlignment constant that represents the alignment for the specified table style.

ActiveDocument.Range.TableStyle.Alignment = wdAlignRowCenter

AllowBreakAcrossPage sets or returns a Long indicating whether lines in the rows of tables formatted with a specified style break across pages.

ActiveDocument.Range.TableStyle.AllowBreakAcrossPage =

AllowPageBreaks allows Microsoft Word to break the specified table across pages.

ActiveDocument.Range.TableStyle.AllowPageBreaks = True

Borders returns a Borders collection that represents all the borders for the specified object.

ActiveDocument.Range.TableStyle.Borders =

BottomPadding returns or sets the amount of space (in points) to add below the contents of a single cell or all the cells in a table.

ActiveDocument.Range.TableStyle.BottomPadding =

ColumnStripe returns or sets a Long that represents the number of columns in the banding when a style specifies odd- or even-column banding.

ActiveDocument.Range.TableStyle.ColumnStripe =

LeftIndent returns or sets a Single that represents the left indent value (in points) for the rows in the specified table style.

ActiveDocument.Range.TableStyle.LeftIndent =

LeftPadding returns or sets the amount of space (in points) to add to the left of the contents of all the cells in a table.

ActiveDocument.Range.TableStyle.LeftPadding =

Parent returns an object that represents the parent object of the specified TableStyle object.

Dim objParent As Object
Set objParent = ActiveDocument.Range.TableStyle.Parent

RightPadding returns or sets the amount of space (in points) to add to the right of the contents of all the cells in a table.

ActiveDocument.Range.TableStyle.RightPadding =

RowStripe returns or sets a Long that represents the number of rows to include in the banding when a style specifies odd- or even-row banding.

ActiveDocument.Range.TableStyle.RowStripe =

Shading returns a Shading object that refers to the shading formatting for the specified table style.

Dim shdShading As Shading
Set shdShading = ActiveDocument.Range.TableStyle.Shading

Spacing returns or sets the spacing (in points) between the cells in a table style.

ActiveDocument.Range.TableStyle.Spacing =

TableDirection returns or sets the direction in which Microsoft Word orders cells in the specified table style.

ActiveDocument.Range.TableStyle.TableDirection = wdTableDirectionLtr

TopPadding returns or sets the amount of space (in points) to add above the contents of all the cells in a table.

ActiveDocument.Range.TableStyle.TopPadding =