InsertBefore Method

Microsoft Publisher Visual Basic

object that represents text appended to the beginning of a text range.

expression.InsertBefore(NewText)

expression    Required. An expression that returns one of the objects in the Applies To list.

NewText   Required String. The text to be inserted.

Example

This example adds Microsoft Publisher's build number and a paragraph break to the beginning of first shape on the first page of the active publication. This example assumes the specified shape is a text frame and not another type of shape.

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