1

我想用名为的字体查找并替换所有重音实例 `Rupee Forandian

最近推出了卢比符号,但没有键盘符号...

当我尝试使用格式功能的excel替换功能CRTL+H时,它会改变整个文本字符串的字体,而我希望它只改变重音`

我找到了 Excel 的解决方案,但我需要一个用于 Powerpoint 2007 的类似解决方案。

Excel中使用的VBA是:

Sub InsertRupeeForandianSymbol()
  Dim X As Long, Cell As Range
  For Each Cell In Selection
    For X = 1 To Len(Cell.Value)
      If Mid(Cell.Value, X, 1) = "`" Then Cell.Characters(X, 1).Font.Name = "Rupee Foradian"
    Next
  Next
End Sub
4

2 回答 2

0

在 Powerpoint 中,您必须遍历 Shapes 才能获取文本:

Sub InsertRupeeForandianSymbol()
    Dim sl As Slide, sh As Shape, X As Long
    For Each sl In ActiveWindow.Selection.SlideRange
        For Each sh In sl.Shapes
            With sh.TextFrame.TextRange.Characters
                For X = 1 To .Count
                    If .Characters(X, 1).Text = "'" Then .Characters(X, 1).Font.Name = "Rupee Forandian"
                Next
            End With
        Next
    Next
End Sub

这将更改所有当前选定幻灯片的字体。您可以更改ActiveWindow.Selection.SlideRangeActivePresentation.Slides应用到当前演示文稿中的所有幻灯片。

于 2013-07-12T07:57:50.563 回答
0

我能想到的最简单的方法是

 Sub InsertRupeeForandianSymbol()
    Dim oSld As Slide
    Dim oShp As Shape
    Dim x As Long
    Dim y As Long

    For Each oSld In ActivePresentation.Slides
     For Each oShp In oSld.Shapes
         For y = 1 To Len(oShp.TextFrame.TextRange)
          If Mid(oShp.TextFrame.TextRange, y, 1) = "`" Then
            oShp.TextFrame.TextRange.Characters(y).Font.Name = "Rupee Foradian"
          End If
         Next y
     Next oShp
    Next oSld
End Sub
于 2013-07-12T08:09:01.027 回答