다음을 통해 공유


Bookmark.InsertSymbol Method

Inserts a symbol in place of the Bookmark control.

Namespace:  Microsoft.Office.Tools.Word
Assembly:  Microsoft.Office.Tools.Word (in Microsoft.Office.Tools.Word.dll)

Syntax

'Declaration
Sub InsertSymbol ( _
    CharacterNumber As Integer, _
    ByRef Font As Object, _
    ByRef Unicode As Object, _
    ByRef Bias As Object _
)
void InsertSymbol(
    int CharacterNumber,
    ref Object Font,
    ref Object Unicode,
    ref Object Bias
)

Parameters

  • CharacterNumber
    Type: System.Int32

    The character number for the specified symbol. This value is always 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). For example, to specify a delta character at position 37 in the table of symbols in the Symbol font, set CharacterNumber to 68.

  • Font
    Type: System.Object%

    The name of the font that contains the symbol.

  • Unicode
    Type: System.Object%

    true to insert the Unicode character specified by CharacterNumber; false to insert the ANSI character specified by CharacterNumber. The default value is false.

  • Bias
    Type: System.Object%

    Sets the font bias for symbols. This argument is useful for setting the correct font bias for East Asian characters. Can be one of the following WdFontBias constants: wdFontBiasDefault, wdFontBiasDontCare, or wdFontBiasFareast. This argument might not be available to you, depending on the language support (U.S. English, for example) that you have selected or installed.

Remarks

Calling this method might delete the Bookmark control.

Optional Parameters

For information on optional parameters, see Optional Parameters in Office Solutions.

Examples

The following code example adds a Bookmark control to the document and then inserts a double-headed arrow into the bookmark. The bookmark is deleted from the document when you use the InsertSymbol method.

This example is for a document-level customization.

Private Sub BookmarkInsertSymbol()
    Me.Paragraphs(1).Range.InsertParagraphBefore()
    Dim Bookmark1 As Microsoft.Office.Tools.Word.Bookmark = _
        Me.Controls.AddBookmark(Me.Paragraphs(1).Range, "Bookmark1")

    Bookmark1.InsertSymbol(171)

End Sub
private void BookmarkInsertSymbol()
{
    this.Paragraphs[1].Range.InsertParagraphBefore();
    Microsoft.Office.Tools.Word.Bookmark bookmark1 =
        this.Controls.AddBookmark(this.Paragraphs[1].Range,
        "bookmark1");

    int CharacterNumber = 171;
    bookmark1.InsertSymbol(CharacterNumber, ref missing, ref missing,
        ref missing);
}

.NET Framework Security

See Also

Reference

Bookmark Interface

Microsoft.Office.Tools.Word Namespace