SetStyle Method

Sets a style to the shape. The style is specified by its name (the Name property).

Applies to: Shape object

Syntax

[[Let] booleanRet =] object.SetStyle ( styleName )

The SetStyle method syntax has these parts:

Part Description
object Required. An expression that returns a Shape object.
styleName Required. An expression that returns a String value. The name of the style (the Name property).
shapeRet Optional. A Boolean type variable.

Remarks

If styleName is an empty string, the SetStyle method applies a null style (No Style) to the shape and returns True. If there is not style with the styleName name in the style collection of the document, which owns object, the SetStyle method doesn't change the current style and returns false. Otherwise, the method applies the new style to the shape and returns True.