PowerPoint VBA-使用宏插入符号

PowerPoint VBA-使用宏插入符号,vba,powerpoint,Vba,Powerpoint,我正在尝试在PowerPoint中插入图标库中的符号。 Unicode值示例-f001 这是我的密码- Sub InsertSymbol() Dim txtBox As Shape Dim s As String s = "f" & "001" 'Add text box Set txtBox = Application.ActivePresentation.Slides(1) _

我正在尝试在PowerPoint中插入图标库中的符号。 Unicode值示例-f001 这是我的密码-

Sub InsertSymbol()

        Dim txtBox As Shape
        Dim s As String

        s = "f" & "001"

        '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:="FontAwesome", CharNumber:=s, Unicode:=msoTrue

    End Sub
错误-运行时错误13 输入Misatch。
任何人都可以修复此问题?

CharNumber
需要
长的
-请参阅


经过一点研究-您的Unicode值
“F001”
需要从十六进制转换为十进制。任何在线十六进制到十进制转换器都将为您提供相应的值
61441
:。

CharNumber
需要
long
-请参阅。如果您尝试手动插入此符号,是否可以看到其Unicode(十六进制)值?@BigBen 1。Dim s显示运行时错误“13”:类型不匹配2。我只能看到字符代码从F00开始…我同意-如果您随后尝试使用
s=“f”和“001”
为其分配
字符串
。我的想法是获取这个字符的Unicode(十六进制)值,然后将其转换为
long
@BigBen有没有办法找到字符的Unicode(十六进制)值?我在FontAwesome论坛的网站上尝试过,但没有得到任何线索。尝试使用
61441
而不是
“f”和“001”
。如果这不起作用,我会安装FontAwesome并尝试复制。