Skip to content

Latest commit

 

History

History
53 lines (32 loc) · 1.26 KB

Word.AutoTextEntries.Add.md

File metadata and controls

53 lines (32 loc) · 1.26 KB
title keywords f1_keywords api_name ms.assetid ms.date ms.localizationpriority
AutoTextEntries.Add method (Word)
vbawd10.chm154599525
vbawd10.chm154599525
Word.AutoTextEntries.Add
7ffa87f9-a23c-1847-3907-84c95f2b7f73
06/08/2017
medium

AutoTextEntries.Add method (Word)

Returns an AutoTextEntry object that represents an AutoText entry added to the list of available AutoText entries.

Syntax

expression.Add (Name, Range)

expression Required. A variable that represents an 'AutoTextEntries' collection.

Parameters

Name Required/Optional Data type Description
Name Required String The text that, when typed, initiates an AutoText entry.
Range Required Range A range of text that will be inserted whenever Name is typed.

Example

This example adds an AutoText entry named Sample Text that contains the text in the selection. This example assumes you have text selected in the active document.

Sub AutoTxt() 
 NormalTemplate.AutoTextEntries.Add Name:="Sample Text", _ 
 Range:=Selection.Range 
End Sub

See also

AutoTextEntries Collection Object

[!includeSupport and feedback]