AutoFormat Method

See Also       Example       Applies To

Table object: Applies a predefined look to a table. The arguments for this method correspond to the options in the Table AutoFormat dialog box (Table menu).

Document or Range object: Automatically formats a document. Use the Kind property to specify a document type.

Syntax 1

expression.AutoFormat(Format, ApplyBorders, ApplyShading, ApplyFont, ApplyColor, ApplyHeadingRows, ApplyLastRow, ApplyFirstColumn, ApplyLastColumn, AutoFit)

Syntax 2

expression.AutoFormat

expression   Required. An expression that returns a Table object (Syntax 1), or an expression that returns a Document or Range object (Syntax 2).

Format   Optional Variant. The predefined table format. Can be any one of the WdTableFormat constants. The default value is wdTableFormatSimple1.

ApplyBorders   Optional Variant. True to apply the border properties of the specified format. The default value is True.

ApplyShading   Optional Variant. True to apply the shading properties of the specified format. The default value is True.

ApplyFont   Optional Variant. True to apply the font properties of the specified format. The default value is True.

ApplyColor   Optional Variant. True to apply the color properties of the specified format. The default value is True.

ApplyHeadingRows   Optional Variant. True to apply the heading-row properties of the specified format. The default value is True.

ApplyLastRow   Optional Variant. True to apply the last-row properties of the specified format. The default value is False.

ApplyFirstColumn   Optional Variant. True to apply the first-column properties of the specified format. The default value is True.

ApplyLastColumn   Optional Variant. True to apply the last-column properties of the specified format. The default value is False.

AutoFit   Optional Variant. True to decrease the width of the table columns as much as possible without changing the way text wraps in the cells. The default value is True.