Word VBA教程:Patterned方法

将指定填充方式设置为一种图案。

expression.Patterned(Pattern)

expression   必需。该表达式返回一个FillFormat对象。

Pattern  MsoPatternType,比需。用于指定填充方式的图案。

MsoPatternType 可以是下列 MsoPatternType 常量之一:
msoPattern10Percent
msoPattern25Percent
msoPattern40Percent
msoPattern5Percent
msoPattern70Percent
msoPattern80Percent
msoPatternDarkDownwardDiagonal
msoPatternDarkUpwardDiagonal
msoPatternDashedDownwardDiagonal
msoPattern20Percent
msoPattern30Percent
msoPattern50Percent
msoPattern60Percent
msoPattern75Percent
msoPattern90Percent
msoPatternDarkHorizontal
msoPatternDarkVertical
msoPatternDashedHorizontal
msoPatternDashedUpwardDiagonal
msoPatternDashedVertical
msoPatternDiagonalBrick
msoPatternDivot
msoPatternDottedDiamond
msoPatternDottedGrid
msoPatternHorizontalBrick
msoPatternLargeCheckerBoard
msoPatternLargeConfetti
msoPatternLargeGrid
msoPatternLightDownwardDiagonal
msoPatternLightHorizontal
msoPatternLightUpwardDiagonal
msoPatternLightVertical
msoPatternMixed
msoPatternNarrowHorizontal
msoPatternNarrowVertical
msoPatternOutlinedDiamond
msoPatternPlaid
msoPatternShingle
msoPatternSmallCheckerBoard
msoPatternSmallConfetti
msoPatternSmallGrid
msoPatternSolidDiamond
msoPatternSphere
msoPatternTrellis
msoPatternWave
msoPatternWeave
msoPatternWideDownwardDiagonal
msoPatternWideUpwardDiagonal
msoPatternZigZag

说明

可用BackColorForeColor属性设置图案颜色。

VBA示例

本示例在活动文档中添加一个作为填充图案的椭圆。


Sub FillPattern()
    With ActiveDocument.Shapes.AddShape _
        (msoShapeOval, 60, 60, 80, 40).Fill
        .ForeColor.RGB = RGB(128, 0, 0)
        .BackColor.RGB = RGB(0, 0, 255)
        .Patterned msoPatternDarkVertical
    End With
End Sub

Word VBA教程

Word VBA参考教程:目录1 Word VBA参考教程:目录2
Word VBA参考教程:目录3 Word VBA参考教程:目录4
Word VBA参考教程:目录5 Word VBA参考教程:目录6
Word VBA参考教程:目录7 Word VBA参考教程:目录8
Word VBA参考教程:目录9 Word VBA参考教程:目录10
版权所有 © 中山市飞娥软件工作室 证书:粤ICP备09170368号