Share via


AutoCorrectEntry.Apply Method

Word Developer Reference

Replaces a range with the value of the specified AutoCorrect entry.

Syntax

expression.Apply(Range)

expression   Required. A variable that represents an AutoCorrectEntry object.

Parameters

Name Required/Optional Data Type Description
Range Required Range The range to which to apply the AutoCorrect entry.

Example

This example adds an AutoCorrect replacement entry, then applies the "sr" AutoCorrect entry to the selected text.

Visual Basic for Applications
  AutoCorrect.Entries.Add Name:= "sr", Value:= "Stella Richards"
AutoCorrect.Entries("sr").Apply Selection.Range

This example applies the "sr" AutoCorrect entry to the first word in the active document.

Visual Basic for Applications
  AutoCorrect.Entries("sr").Apply ActiveDocument.Words(1)

See Also