TypeText Method Example

If Typing replaces selection is selected on the Edit tab in the Options dialog box, this example collapses the selection before inserting "Hello." This technique prevents existing document text from being replaced.

If Options.ReplaceSelection = True Then
    Selection.Collapse Direction:=wdCollapseStart
    Selection.TypeText Text:="Hello"
End If

This example inserts "Title" followed by a new paragraph.

Options.ReplaceSelection = False
With Selection
    .TypeText Text:="Title"
    .TypeParagraph
End With