Range.ModifyEnclosure 方法 (Word)Range.ModifyEnclosure method (Word)

加入、修改或移除一個或多個指定字元周圍的圍繞符號。Adds, modifies, or removes an enclosure around the specified character or characters.


expressionexpression. ModifyEnclosure( _Style_ , _Symbol_ , _EnclosedText_ )

需要 expressionexpression Required. 代表 Range 物件的變數。A variable that represents a Range object.


名稱Name 必要/選用Required/Optional 資料類型Data type 描述Description
StyleStyle 必要Required VariantVariant 圍繞符號樣式。The style of the enclosure. 可以是任何WdEncloseStyle常數。Can be any WdEncloseStyle constant.
SymbolSymbol 選用Optional VariantVariant 用來括住指定的範圍中的符號。The symbol in which to enclose the specified range. 可以是任何WdEnclosureType常數。Can be any WdEnclosureType constant.
EnclosedTextEnclosedText 選用Optional VariantVariant 您想要圍繞的字元。The characters that you want to enclose. 如果您加入此引數,Microsoft Word 就會將指定的範圍取代成圍繞字元。If you include this argument, Microsoft Word replaces the specified range with the enclosed characters. 如果您未指定要圍繞的文字,Microsoft Word 就會圍繞指定範圍中的所有文字。If you don't specify text to enclose, Microsoft Word encloses all text in the specified range.


這則範例會將目前的選取項目取代成圓圈圍繞的數字 25。This example replaces the current selection with the number 25 enclosed in a circle.

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

另請參閱See also

Range 物件Range Object

支援和意見反應Support and feedback

有關於 Office VBA 或這份文件的問題或意見反應嗎?Have questions or feedback about Office VBA or this documentation? 如需取得支援服務並提供意見反應的相關指導,請參閱 Office VBA 支援與意見反應Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.