Partager via


Range.ModifyEnclosure Method (Word)

Adds, modifies, or removes an enclosure around the specified character or characters.

Syntax

expression .ModifyEnclosure(Style, Symbol, EnclosedText)

expression Required. A variable that represents a Range object.

Parameters

Name

Required/Optional

Data Type

Description

Style

Required

Variant

The style of the enclosure. Can be any WdEncloseStyle constant.

Symbol

Optional

Variant

The symbol in which to enclose the specified range. Can be any WdEnclosureType constant.

EnclosedText

Optional

Variant

The characters that you want to enclose. If you include this argument, Microsoft Word replaces the specified range with the enclosed characters. If you don't specify text to enclose, Microsoft Word encloses all text in the specified range.

Example

This example replaces the current selection with the number 25 enclosed in a circle.

Selection.Range.ModifyEnclosure wdEncloseStyleLarge, _ 
 wdEnclosureCircle, "25"

See Also

Concepts

Range Object Members

Range Object