Share via


TextRange.Text Property (Publisher)

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.

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