PowerPoint VBA教程:Pattern属性

应用于 LineFormat对象的 Pattern属性。

设置或返回某值,该值代表应用于指定行的图案。可读写。MsoPatternType 类型。

MsoPatternType 可以是下列 MsoPatternType 类型常数之一。
msoPattern10Percent
msoPattern20Percent
msoPattern25Percent
msoPattern30Percent
msoPattern40Percent
msoPattern50Percent
msoPattern5Percent
msoPattern60Percent
msoPattern70Percent
msoPattern75Percent
msoPattern80Percent
msoPattern90Percent
msoPatternDarkDownwardDiagonal
msoPatternDarkHorizontal
msoPatternDarkUpwardDiagonal
msoPatternDashedDownwardDiagonal
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
msoPatternDarkVertical

expression.Pattern

expression  必选。该表达式返回上述对象之一。

 

应用于 FillFormat对象的 Pattern属性。

设置或返回某值,该值代表应用于指定填充的图案。使用BackColorForeColor属性设置在图案中使用的颜色。只读。MsoPatternType 类型。

MsoPatternType 可以是下列 MsoPatternType 类型常数之一。
msoPattern10Percent
msoPattern20Percent
msoPattern25Percent
msoPattern30Percent
msoPattern40Percent
msoPattern50Percent
msoPattern5Percent
msoPattern60Percent
msoPattern70Percent
msoPattern75Percent
msoPattern80Percent
msoPattern90Percent
msoPatternDarkDownwardDiagonal
msoPatternDarkHorizontal
msoPatternDarkUpwardDiagonal
msoPatternDashedDownwardDiagonal
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
msoPatternDarkVertical

expression.Pattern

expression  必选。该表达式返回上述对象之一。

VBA示例

应用于 LineFormat对象。

本示例在myDocument 中添加具有图案的行。


Set myDocument = ActivePresentation.Slides(1)
With myDocument.Shapes.AddLine(10, 100, 250, 0).Line
    .Weight = 6
    .ForeColor.RGB = RGB(0, 0, 255)
    .BackColor.RGB = RGB(128, 0, 0)
    .Pattern = msoPatternDarkDownwardDiagonal
End With

应用于 FillFormat对象。

本示例向myDocument 中添加矩形,并且设置矩形的填充图案以适应名为“rect1”的形状中的填充图案。新矩形使用和 rect1 相同的图案,但是颜色没有必要相同。通过 BackColor 和 ForeColor属性设置在该图案中使用的颜色。


Set myDocument = ActivePresentation.Slides(1)
With myDocument.Shapes
    pattern1 = .Item("rect1").Fill.Pattern
    With .AddShape(msoShapeRectangle, 100, 100, 120, 80).Fill
        .ForeColor.RGB = RGB(128, 0, 0)
        .BackColor.RGB = RGB(0, 0, 255)
        .Patterned pattern1
    End With
End With

上页:PowerPoint VBA教程:Path属性 下页:PowerPoint VBA教程:PauseAnimation属性

PowerPoint VBA教程:Pattern属性

PowerPoint VBA教程:PauseAnimation属性 PowerPoint VBA教程:Perspective属性
PowerPoint VBA教程:PictureFormat属性 PowerPoint VBA教程:PlaceholderFormat属性
PowerPoint VBA教程:Placeholders属性 PowerPoint VBA教程:PlayOnEntry属性
PowerPoint VBA教程:PlaySettings属性 PowerPoint VBA教程:PointerColor属性
PowerPoint VBA教程:PointerType属性 PowerPoint VBA教程:Points属性
PowerPoint VBA教程:Position属性 PowerPoint VBA教程:Presentation属性
PowerPoint VBA教程:PresentationElapsedTime属性 PowerPoint VBA教程:Presentations属性
PowerPoint VBA教程:Preserved属性 PowerPoint VBA教程:PresetExtrusionDirection属性
PowerPoint VBA教程:PresetGradientType属性 PowerPoint VBA教程:PresetLightingDirection属性
PowerPoint VBA教程:PresetLightingSoftness属性 PowerPoint VBA教程:PresetMaterial属性
版权所有 © 中山市飞娥软件工作室 证书:粤ICP备09170368号