Share via


SetShapesDefaultProperties Method

This content is no longer actively maintained. It is provided as is, for anyone who may still be using these technologies, with no warranties or claims of accuracy with regard to the most recent product version or service release.

Applies the formatting for the specified shape or shape range to the default shape. Shapes created after this method has been used will have this formatting applied to them by default.

expression.SetShapesDefaultProperties

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

Example

This example adds a rectangle to the active publication, formats the rectangle's fill, applies the rectangle's formatting to the default shape, and then adds another smaller rectangle to the document. The second rectangle has the same fill as the first one.

  With ActiveDocument.Pages(1).Shapes

    With .AddShape(Type:=msoShapeRectangle, _
            Left:=5, Top:=5, Width:=80, Height:=60)
        With .Fill
            .ForeColor.RGB = RGB(0, 0, 255)
            .BackColor.RGB = RGB(0, 204, 255)
            .Patterned Pattern:=msoPatternHorizontalBrick
        End With
        .SetShapesDefaultProperties
    End With

    .AddShape Type:=msoShapeRectangle, _
        Left:=90, Top:=90, Width:=40, Height:=30

End With