|
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
又有一段代码,如下,要实现在ppt中自负的替换,代码如下://
Sub 批量替换字符2()
arr = Array("A", "C", "E", "G", "I", "K", "M") '被替换的字符
brr = Array("B", "D", "F", "H", "J", "L", "N") '替换后的字符
x = LBound(arr)
Z = UBound(arr)
Dim sld As Slide, shp As Shape
For Each sld In ActivePresentation.Slides
For Each shp In sld.Shapes
If shp.HasTextFrame Then
If shp.TextFrame.HasText Then
Set trng = shp.TextFrame.TextRange
For i = x To Z
trng.Find.Execute findtext:=arr(i), replacewith:=b(i), Replace:=wdReplaceAll, Forward:=True '这一句有问题,如何表达?????
Next
End If
End If
Next
Next
End Sub
问题出在:
trng.Find.Execute findtext:=arr(i), replacewith:=b(i), Replace:=wdReplaceAll, Forward:=True
请问如何表达???才能运行正常??? |
|