InsertAutoText Method

Attempts to match the text in the specified range or the text surrounding the range with an existing AutoText entry name. If any such match is found, InsertAutoText inserts the AutoText entry to replace that text. If a match cannot be found, an error occurs.

Note  You can use the Insert method with an AutoTextEntry object to insert a specific AutoText entry.


expression Required. An expression that returns a Range object.


This example inserts an AutoText entry that matches the text around a selection.

Selection.TypeText "Best w"

This example inserts an AutoText entry with a name that matches the first word in the active document.

Selection.TypeText "In "
Set myRange = ActiveDocument.Words(1)

Applies to | Range Object

See Also | AutoTextEntries Collection Object | Insert Method