Table of contents
TOC
Collapse the table of content
Expand the table of content

TextRange.Text Property (Publisher)

office 365 dev account|Last Updated: 8/24/2017
|
3 Contributors

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
© 2018 Microsoft