Expand Minimize
This topic has not yet been rated - Rate this topic

Shape.AutoShapeType Property (Word)

Returns or sets the shape type for the specified Shape object, which must represent an AutoShape other than a line or freeform drawing. Read/write MsoAutoShapeType.

expression .AutoShapeType

expression Required. A variable that represents a Shape object.

When you change the type of a shape, the shape retains its size, color, and other attributes.

This example replaces all 16-point stars with 32-point stars in the active document.

Sub ReplaceAutoShape() 
 Dim docNew As Document 
 Dim shpStar As Shape 
 Set docNew = ActiveDocument 
 For Each shpStar In docNew.Shapes 
 If shpStar.AutoShapeType = msoShape16pointStar Then 
 shpStar.AutoShapeType = msoShape32pointStar 
 End If 
 Next 
End Sub
Did you find this helpful?
(1500 characters remaining)

Community Additions

ADD
© 2013 Microsoft. All rights reserved.