Share via


Text Property

This content is no longer actively maintained. It is provided as is, for anyone who may still be using these technologies, with no warranties or claims of accuracy with regard to the most recent product version or service release.  

Text property as it applies to the TextEffectFormat and TextRange objects.

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

expression.Text

expression   Required. An expression that returns one of the above objects.

Text property as it applies to the PhoneticGuide object.

Returns a String that represents the contents of phonetic text. Read-only.

expression.Text

expression   Required. An expression that returns one of the above objects.

Example

As it applies to the TextRange object.

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

As it applies to the TextEffectFormat object.

The following example changes the text and sets the font name and formatting properties for shape one on the first page of the active publication. For this example to work, shape one must be a WordArt object.

  Sub FormatWordArt()
    With ActiveDocument.Pages(1).Shapes(1).TextEffect
        .Text = "This is a test."
        .FontName = "Courier New"
        .FontBold = True
        .FontItalic = True
    End With
End Sub