2013-07-12 59 views
1

我想找到並更換grave accent`名爲Rupee Forandian在文本中的Power Point替換特定字符的字體名稱

近日盧比符號發起字體的所有實例,並沒有鍵盤符號爲...

當我嘗試Excel的替換功能CRTL + H^格式化功能,它改變了整個文本字符串的字體,而我希望它只改變重音`

我找到了Excel中的一個解決方案,但我需要用一個類似PowerPoint 2007中

的VBA在Excel中使用的是:

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 

回答

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 
+1

這個工作,感謝.. – Chainsaw

0

在PowerPoint中你必須通過形狀來讓文本進行迭代:

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.SlideRange更改爲ActivePresentation.Slides並應用於當前演示文稿中的所有幻燈片。要做到這一點,我能想到的

相關問題