Table.ApplyAutoFormat method (Publisher)

Applies automatic built-in table formatting to a specified table.

Syntax

expression.ApplyAutoFormat (AutoFormat, TextFormatting, TextAlignment, Fill, Borders)

expression A variable that represents a Table object.

Parameters

Name Required/Optional Data type Description
AutoFormat Required PbTableAutoFormatType The type of automatic formatting to apply to the specified table. Can be one of the PbTableAutoFormatType constants declared in the Microsoft Publisher type library.
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.

Example

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

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.