TextRange.InsertSymbol Method
Returns a TextRange object that represents a symbol inserted into the specified text range.
Namespace: Microsoft.Office.Interop.PowerPoint
Assembly: Microsoft.Office.Interop.PowerPoint (in Microsoft.Office.Interop.PowerPoint.dll)
Syntax
'Declaration
Function InsertSymbol ( _
FontName As String, _
CharNumber As Integer, _
Unicode As MsoTriState _
) As TextRange
'Usage
Dim instance As TextRange
Dim FontName As String
Dim CharNumber As Integer
Dim Unicode As MsoTriState
Dim returnValue As TextRange
returnValue = instance.InsertSymbol(FontName, _
CharNumber, Unicode)
TextRange InsertSymbol(
string FontName,
int CharNumber,
MsoTriState Unicode
)
Parameters
- FontName
Type: System.String
The font name.
- CharNumber
Type: System.Int32
The Unicode or ASCII character number.
- Unicode
Type: Microsoft.Office.Core.MsoTriState
Specifies whether the CharNumber argument represents an ASCII or Unicode character.
Return Value
Type: Microsoft.Office.Interop.PowerPoint.TextRange
TextRange
Remarks
The CharNumber parameter value can be one of these MsoTriState constants.
Constant |
Description |
---|---|
msoFalse |
The default. The CharNumber argument represents an ASCII character number. |
msoTrue |
The CharNumber argument represents a Unicode character. |
Examples
This example inserts the registered trademark symbol after the first sentence of the first paragraph in a new text box on the first slide in the active presentation.
Sub Symbol()
Dim txtBox As Shape
'Add text box
Set txtBox = Application.ActivePresentation.Slides(1) _
.Shapes.AddTextbox(Orientation:=msoTextOrientationHorizontal, _
Left:=100, Top:=100, Width:=100, Height:=100)
'Add symbol to text box
txtBox.TextFrame.TextRange.InsertSymbol_
FontName:="Symbol", CharNumber:=226
End Sub