1
votes

references that was selected:
  - visual basic for applications
  - Microsoft powerpoint 14.0 object library
  - ole automation
  - Microsoft office 14.0 object library

how to determine the character's code using Dialogs(wdDialogInsertSymbol) and what other reference(s) should be selected?

thanks.

Sub fdjlas() Dim osh As Shape Dim oSl As Slide

For Each oSl In ActivePresentation.Slides
    For Each osh In oSl.Shapes
        If osh.HasTextFrame Then
            With osh.TextFrame.TextRange
                For i = 1 To .Characters.Count
                    With .Characters(i).Font
                        MsgBox ("Char number: " & Dialogs(wdDialogInsertSymbol).CharNum)
                    End With
                Next
            End With
        End If
    Next
Next

MsgBox ("done")

End Sub


OUTPUT:


Compile error:

Method or data member not found

MsgBox ("Char number: " & Dialogs(wdDialogInsertSymbol).CharNum)


* the Dialogs gets highlighted

1
The wd in wdDialogInsertSymbol almost certainly indicates a Word constant. What exactly are you trying to accomplish? Displaying the symbol corresponding to a given character number or the character number itself?Steve Rindsberg
I want to display the corresponding character number itself like if the character "x" is selected then the prompt should be "Char number: 120" thanks.user3156783

1 Answers

-1
votes

Something like this then?

Dim oSl As Slide
Dim oSh As Shape
Dim i As Long

For Each oSl In ActivePresentation.Slides
    For Each oSh In oSl.Shapes
        If oSh.HasTextFrame Then
            With oSh.TextFrame.TextRange
                For i = 1 To .Characters.Count
                    'With .Characters(i).Font
                    '    MsgBox ("Char number: " & Dialogs(wdDialogInsertSymbol).CharNum)
                    'End With
                    MsgBox .Characters(i) & ": " & Asc(.Characters(i))
                Next
            End With
        End If
    Next
Next