Shading Object

Word Developer Reference

Contains shading attributes for an object.

Remarks

Use the Shading property to return the Shading object. The following example applies fine gray shading to the first paragraph in the active document.

Visual Basic for Applications
  ActiveDocument.Paragraphs(1).Shading.Texture = wdTexture10Percent

The following example applies shading with different foreground and background colors to the selection.

Visual Basic for Applications
  With Selection.Shading
    .Texture = wdTexture20Percent
    .ForegroundPatternColorIndex = wdBlue
    .BackgroundPatternColorIndex = wdYellow
End With

The following example applies a vertical line texture to the first row in the first table in the active document.

Visual Basic for Applications
  ActiveDocument.Tables(1).Rows(1).Shading.Texture = _
    wdTextureVertical

See Also