Rah*_*gli -2 powerpoint vba powerpoint-vba
我想在ppt的幻灯片1中将"hello"替换为"world".如何使用VBA脚本执行此操作.
Sub findAndReplaceText()
Dim sld As Slide
Set sld = ActivePresentation.Slides(1)
Dim shp As Shape
For Each shp In sld.Shapes
If shp.HasTextFrame Then
If shp.TextFrame.HasText Then
shp.TextFrame.TextRange.Text = Replace(shp.TextFrame.TextRange.Text, "hello", "world")
End If
End If
Next shp
End Sub
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
6404 次 |
| 最近记录: |