Поделиться через


AutoTextEntry.Insert Method (Word)

Inserts the AutoText entry in place of the specified range. Returns a Range object that represents the AutoText entry.

Syntax

expression .Insert(Where, RichText)

expression Required. A variable that represents an AutoTextEntry object.

Parameters

Name

Required/Optional

Data Type

Description

Where

Required

Range

The location for the AutoText entry.

RichText

Optional

Variant

True to insert the AutoText entry with its original formatting.

Return Value

Range

Remarks

If you don't want to replace the range, use the Collapse method before using this method.

Example

This example inserts the formatted AutoText entry named "one" after the selection.

Sub InsertAutoTextEntry() 
 ActiveDocument.Content.Select 
 Selection.Collapse Direction:=wdCollapseEnd 
 ActiveDocument.AttachedTemplate.AutoTextEntries("one").Insert _ 
 Where:=Selection.Range, RichText:=True 
End Sub

See Also

Concepts

AutoTextEntry Object Members

AutoTextEntry Object