Applies automatic built-in table formatting to a specified table.
expression. ApplyAutoFormat( AutoFormat, TextFormatting, TextAlignment, Fill, Borders)
_expression_A variable that represents a Table object.
Name | Required/Optional | Data Type | Description |
---|---|---|---|
AutoFormat | Required | PbTableAutoFormatType | The type of automatic formatting to apply to the specified table. |
TextFormatting | Optional | Boolean | True to apply font formatting to the text in the table. Default value is True. |
TextAlignment | Optional | Boolean | True to apply text alignment to the text in the table. Default value is True. |
Fill | Optional | Boolean | True to apply fill formatting to cells in the table. Default value is True. |
Borders | Optional | Boolean | True to apply borders to cells in the table. Default value is True. |
The AutoFormat parameter can be one of the PbTableAutoFormatType constants declared in the Microsoft Publisher type library.
This example applies the checkbook register automatic formatting, with fill and borders, to the specified table.
Sub ApplyAutomaticTableFormatting()
ActiveDocument.Pages(1).Shapes(1).Table.ApplyAutoFormat _
AutoFormat:=pbTableAutoFormatCheckbookRegister, _
Borders:=False
End Sub