AutoCorrectEntry.Apply method (Word)

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.

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.

AutoCorrect.Entries("sr").Apply ActiveDocument.Words(1)

See also

AutoCorrectEntry Object

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.