TextFrame.TextRange property (Word)
Returns a Range object that represents the text in the specified text frame.
Syntax
expression.TextRange
expression An expression that returns a 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
See also
Support and feedback
Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.