TextRange.InsertAfter method (Publisher)

Returns a TextRange object that represents text appended to the end of a text range.

Syntax

expression.InsertAfter (NewText)

expression A variable that represents a TextRange object.

Parameters

Name Required/Optional Data type Description
NewText Required String The text to be inserted.

Return value

TextRange

Example

This example adds the Microsoft Publisher build number to the end of the first shape on the first page of the active publication. This example assumes that the specified shape is a text frame and not another type of shape.

Sub AppendText() 
 With ActiveDocument.Pages(1).Shapes(1) 
 .TextFrame.TextRange.InsertAfter _ 
 NewText:="Microsoft Publisher Build : " & Build 
 End With 
End Sub

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.