共用方式為


Shape.AutoShapeType Property

Word Developer Reference

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.

Syntax

expression.AutoShapeType

expression   Required. A variable that represents a Shape object.

Remarks

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

Example

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

Visual Basic for Applications
  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

See Also