InsertSymbol 方法 (Word)Selection.InsertSymbol method (Word)

插入一个符号,用来替换指定的所选内容。Inserts a symbol in place of the specified selection.


expressionexpression. InsertSymbol( _CharacterNumber_ , _Font_ , _Unicode_ , _Bias_ )

expression:必需。expression Required. 表示 Selection 对象的变量。A variable that represents a Selection object.


名称Name 必需/可选Required/Optional 数据类型Data type 说明Description
CharacterNumberCharacterNumber 必需Required LongLong 指定符号的字符编号。The character number for the specified symbol. 该值应是 31 加上此符号在符号表中的位置(从左向右计算)相应的数字。This value will always be the sum of 31 and the number that corresponds to the position of the symbol in the table of symbols (counting from left to right). 例如,要指定一个位于"Symbol"字体符号表中第 37 号位置的 delta 字符,请将 CharacterNumber 设置为 68。For example, to specify a delta character at position 37 in the table of symbols in the Symbol font, set CharacterNumber to 68.
FontFont 可选Optional VariantVariant 包含符号的字体的名称。The name of the font that contains the symbol.
UnicodeUnicode 可选Optional VariantVariant 要插入 unicode 字符指定的 CharacterNumber; 以插入由 CharacterNumber 指定的 ANSI 字符。True to insert the unicode character specified by CharacterNumber; False to insert the ANSI character specified by CharacterNumber. 默认值为 FalseThe default value is False.
BiasBias 可选Optional VariantVariant 设置符号的字体偏量。Sets the font bias for symbols. 此参数可用于设置东亚字符正确的字体斜线。This argument is useful for setting the correct font bias for East Asian characters. 可以是WdFontBias常量之一。Can be one of the WdFontBias constants. 根据您所选择或安装的语言支持(例如,美国英语),此参数可能不可用。This argument may not be available to you, depending on the language support (U.S. English, for example) that you have selected or installed.


如果不想替换所选内容, 请在使用此方法之前使用Collapse方法。If you don't want to replace the selection, use the Collapse method before you use this method.


以下示例在插入点插入一个双向箭头。This example inserts a double-headed arrow at the insertion point.

With Selection 
 .Collapse Direction:=wdCollapseStart 
 .InsertSymbol CharacterNumber:=171, _ 
 Font:="Symbol", Unicode:=False 
End With

另请参阅See also

Selection 对象Selection 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.