You're on the right track. Assume I have a shape like this, where it has letters and also a special character, represented by the hex value &H25B2
.
First, you need to identify what is the value of your character. There are lots of places where you can find these references.
Then, how to work with in your code, here is one example that finds the shape, and covers it with your arrow, revised per @SteveRindsberg's suggestion, below :)
Public Const upArrow As String = &H25B2 'This is the Hex code for the upward triangle/arrow
Public Const downArrow As String = &H25BC 'This is the Hex code for the downward triangle/arrow
Sub WorkWithSpecialChars()
Dim pres As Presentation
Dim sld As Slide
Dim shp As Shape
Dim foundAt As Long
Dim arrowTop As Double
Dim arrowLeft As Double
Dim arrow As Shape
Set pres = ActivePresentation
For Each sld In pres.Slides
For Each shp In sld.Shapes
If shp.HasTextFrame Then
foundAt = InStr(shp.TextFrame.TextRange.Characters.Text, ChrW(upArrow))
If foundAt > 0 Then
MsgBox "Slide " & sld.SlideIndex & " Shape " & shp.Name & " contains " & _
"the character at position " & foundAt, vbInformation
'Select the text
With shp.TextFrame.TextRange.Characters(foundAt, 1)
'Get the position of the selected text & add the arrow
Set arrow = sld.Shapes.AddShape(36, _
.BoundLeft, .BoundTop, .BoundWidth, .BoundHeight)
'additional code to format the shape
' or call a subroutine to format the shape, etc.
End With
Else:
Debug.Print "Not found in shape " & shp.Name & ", Slide " & sld.SlideIndex
End If
End If
Next
Next
End Sub