ShapeRange.ConvertToFrame Method

Word Developer Reference

Converts the specified shape to a frame.

Syntax

expression.ConvertToFrame

expression   Required. A variable that represents a ShapeRange object.

Return Value
Frame

Remarks

Shapes that don't support attached text cannot be converted to frames. For pictures, OLE objects, and ActiveX controls, use the ConvertToInlineShape method.

If you use this method on a ShapeRange object that contains more than one shape, an error occurs.

In Word 97 and later, frames have been replaced by text boxes.

Example

This example creates a text box using the selected text, and then it converts the text box to a frame.

Visual Basic for Applications
  If Selection.Type = wdSelectionNormal Then
    Selection.CreateTextbox
    Selection.ShapeRange.ConvertToFrame
End If

See Also