全部显示

SetShapesDefaultProperties 方法

       

将指定形状的格式应用于默认形状。默认情况下,使用该方法后创建的形状都将使用此格式。

expression.SetShapesDefaultProperties

expression  必选。该表达式返回一个 Shape 对象。

示例

本示例向 myDocument 中添加矩形,格式化矩形的填充,将该矩形的格式应用于默认形状,再向该文档中添加一个较小的矩形。第二个矩形的填充与第一个矩形相同。

Set mydocument = ActivePresentation.Slides(1)
With mydocument.Shapes
    With .AddShape(msoShapeRectangle, 5, 5, 80, 60)
        With .Fill
            .ForeColor.RGB = RGB(0, 0, 255)
            .BackColor.RGB = RGB(0, 204, 255)
            .Patterned msoPatternHorizontalBrick
        End With
    ' Sets formatting for default shapes
        .SetShapesDefaultProperties
    End With
' New shape has default formatting
    .AddShape msoShapeRectangle, 90, 90, 40, 30
End With