Text Property
The document is archived and information here might be outdated

TextRange.Text Property

Office 2007
Returns or sets a String that represents the text in a text range or WordArt shape. Read/write.

Syntax

expression.Text

expression   A variable that represents a TextRange object.

Example

The following example adds a rectangle to the active publication and adds text to it.

Visual Basic for Applications
Sub AddTextToShape()
    With ActiveDocument.Pages(1).Shapes.AddShape(Type:=msoShapeRectangle, _
        Left:=72, Top:=72, Width:=250, Height:=140)
        .TextFrame.TextRange.Text = "Here is some test text"
    End With
End Sub



Show:
© 2016 Microsoft