0
下面我有一些代碼找到並替換某個單詞。但是,我對VBA的瞭解有限,所以我不知道如何通過文件夾中的多個Powerpoint文件來循環此代碼並保存它們。另外它只需要在第一張紙上寫下文字,我不知道這是怎麼回事?通過多個文件循環VBA
Sub DemoFindReplace()
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, "TEST", "REPLACE")
End If
End If
Next shp
End Sub
請注意你的代碼將打破所有文本框的格式,除非它們在字體,粗體等方面沒有內部差異。 – Jbjstam