本文介绍了如何使用VBA在Powerpoint中查找和替换字符串的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! 我想在ppt的幻灯片1上将 hello替换为 world。I would like to replace the word "hello" with "world" on slide 1 of the ppt. How can I do that using VBA script.推荐答案Sub findAndReplaceText()Dim sld As SlideSet sld = ActivePresentation.Slides(1)Dim shp As ShapeFor Each shp In sld.ShapesIf shp.HasTextFrame Then If shp.TextFrame.HasText Then shp.TextFrame.TextRange.Text = Replace(shp.TextFrame.TextRange.Text, "hello", "world") End IfEnd IfNext shpEnd Sub 这篇关于如何使用VBA在Powerpoint中查找和替换字符串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
06-22 04:23