Range.InsertAutoText Method (Word)

Office 2013 and later

Contribute to this content

Use GitHub to suggest and submit changes. See our guidelines for contributing to VBA documentation.

Attempts to match the text in the specified range or the text surrounding the range with an existing AutoText entry name.

expression .InsertAutoText

expression Required. A variable that represents a Range object.

If Word finds a match, InsertAutoText inserts the AutoText entry to replace that text. If Word cannot find a match, an error occurs.

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

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) 


Other resources