Text Property

Microsoft Publisher Visual Basic

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.

ShowText 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

ShowAs 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
				

ShowAs 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