Show AllShow All

Condition Method

Returns a ConditionalStyle object that represents special style formatting for a portion of a table.

expression.Condition(ConditionCode)

expression    Required. An expression that returns one of the objects in the Applies To list.

ConditionCode   Required WdConditionCode. The are of the table to which to apply the formatting.

Example

This example selects the first table in the active document and adds a 20 percent shading to odd-numbered columns.

Sub TableStylesTest()
    With ActiveDocument

        'Select the table to which the conditional
        'formatting will apply
        .Tables(1).Select

        'Specify the conditional formatting
        .Styles("Table Grid").Table _
            .Condition(wdOddColumnBanding).Shading _
            .BackgroundPatternColor = wdColorGray20
    End With
End Sub
		
©2003 Microsoft Corporation. All rights reserved.