我正在尝试复制 Powerpoint 2007 中“查找”按钮的行为。我已经能够编写 vba 来查找我正在搜索的文本,但我想将包含文本的形状带到主要的中心窗户。我的代码选择了正确的幻灯片和形状,只是不可见。
ppt.Presentations.open(strFloorPlan)
For each sld in ppt.Activepresentation.Slides
For each shp in sld.shapes
if shp.hasTextFrame then
set txtrng = shp.textFrame.TextRange
set foundtext =txtrnd.Find(findwhat:="A string representing my search criteria)
do while not (foundtext is nothing)
sld.select 'This works
shape.select 'This works
**At this point I have my text selected, but is off screen. I would like it to be in the current ppt window, so the users do not net to find it.**
Loop
End if
Next
Next