TextRange Property

Applies To

TextFrame object.

Description

Returns a Range object that represents the text in the specified text frame. Read-only.

See Also

TextFrame object.

Example

This example adds a text box to the active document and then adds text to the text
box.

Set myTBox = ActiveDocument.Shapes.AddTextBox _
    (Orientation:=msoTextOrientationHorizontal, Left:=100, Top:=100, _
    Width:=300, Height:=200)
myTBox.TextFrame.TextRange = "Test Box"
This example adds text to TextBox 1 in the active document.

ActiveDocument.Shapes("TextBox 1").TextFrame.TextRange.InsertAfter("New Text")
This example returns the text from TextBox 1 in the active document and displays it in a message box.

MsgBox ActiveDocument.Shapes("TextBox 1").TextFrame.TextRange.Text