Export (0) Print
Expand All

TextRange.InsertSymbol Method

Office 2007
Returns a TextRange object that represents a symbol inserted in place of the specified range or selection.

Syntax

expression.InsertSymbol(FontName, CharIndex)

expression   A variable that represents a TextRange object.

Parameters

NameRequired/OptionalData TypeDescription
FontNameRequiredStringThe name of the font that contains the symbol.
CharIndexRequiredLongThe Unicode character number for the specified symbol.

Return Value
TextRange

Remarks

If you do not want to replace the range or selection, use the Collapse method before you use this method.

Example

This example inserts a double-headed arrow at the cursor.

Visual Basic for Applications
Sub InsertArrow()
    ActiveDocument.Pages(1).Shapes(1).TextFrame.TextRange _
        .Paragraphs(Start:=1, Length:=1).Select

    With Selection.TextRange
        .Collapse Direction:=pbCollapseStart
        .InsertSymbol FontName:="Symbol", CharIndex:=171
    End With

End Sub



Community Additions

ADD
Show:
© 2014 Microsoft