ModifyEnclosure Method
TOC
Collapse the table of content
Expand the table of content

Range.ModifyEnclosure Method (Word)

Office 2013 and later
GitHub-Mark-64px

Contribute to this content

Use GitHub to suggest and submit changes. See our guidelines for contributing to VBA documentation.

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

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.

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

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

Concepts

Other resources

Show:
© 2016 Microsoft