Style property (Shape object)
Gets or sets the style for a Shape object.
Version added
2.0
Syntax
| |
| |
strRet |
String. The fill style component of the style. |
object |
Required. An expression that returns a Shape object that has or gets the style. |
stringExpression |
Required String. The name of the style to apply. |
Remarks
If a style consists of different text, line, and fill styles, the Style property returns the fill style. If you set the Style property to a nonexistent style, your program generates an error.
To preserve local formatting, use the StyleKeepFmt property.
Beginning with Visio 2002, an empty string ("") will cause the master's style to be reapplied to the shape. (Earlier versions generate a "no such style" exception.) If the shape has no master, its style remains unchanged. Setting stringExpression to an empty string is the equivalent of selecting Use master's format in the Text style, Line style, or Fill style list in the Style dialog box (on the Format menu, click Style).