ConvertToShape Method

Microsoft Word Visual Basic

Creates a shape that has the geometric characteristics of the specified object. Returns a Shape object that represents the new shape.

expression.ConvertToShape(Anchor)

expression    Required. An expression that returns a FreeformBuilder object.

Anchor   Optional Variant. A Range object that represents the text to which the shape is bound. If Anchor is specified, the anchor is positioned at the beginning of the first paragraph in the anchoring range. If this argument is omitted, the anchoring range is selected automatically and the shape is positioned relative to the top and left edges of the page.

ShowConvertToShape method as it applies to the InlineShape object.

Converts an inline shape to a free-floating shape. Returns a Shape object that represents the new shape.

expression.ConvertToShape

expression    Required. An expression that returns an InlineShapes object.

Remarks

You must apply the AddNodes method to a FreeformBuilder object at least once before you use the ConvertToShape method.

Example

ShowAs applies to the InlineShape object.

This example converts the first inline shape in the active document to a floating shape.

ActiveDocument.InlineShapes(1).ConvertToShape
				

ShowAs applies to the FreeFormBuilder object.

This example adds a freeform with five vertices to myDocument.

Set myDocument = ActiveDocument
With myDocument.Shapes.BuildFreeform(msoEditingCorner, 360, 200)
    .AddNodes msoSegmentCurve, msoEditingCorner, _
        380, 230, 400, 250, 450, 300
    .AddNodes msoSegmentCurve, msoEditingAuto, 480, 200
    .AddNodes msoSegmentLine, msoEditingAuto, 480, 400
    .AddNodes msoSegmentLine, msoEditingAuto, 360, 200
    .ConvertToShape
End With