Avatar of RIBBIT_Productions
RIBBIT_Productions
 asked on

In VBA for PowerPoint 2010, how do I use the built-in "Find" dialog's "Find Next" function?

Hello all.

This is about VBA for PowerPoint 2010. The goal is to use PPT's built-in "Find Next" function that is accessed through the "Find" dialog, instead of having to write code to loop through slides, shapes and text ranges, which seems ridiculously redundant!

I found that the control id for the "Find" dialog is 141, and the control id for the "Find Next" button is 570 (correct me if I'm wrong or off track).

I can display the "Find" dialog like so:
CommandBars.FindControl(id:=141).Execute

But when I try to use the "Find Next" button the same way I get a "Object variable of With block variable not set" error:
CommandBars.FindControl(id:=570).Execute

Actually I don't even want to display the dialog; I just want to use its functions behind the scene...

So, first I need to know how to paste a string in the "Find what" combobox (or something to that effect). By the way, I tried pasting after the dialog is called, but the paste is done on the slide instead of in the combobox...

Then I need to know, using VBA, how to activate the "Find Next" button (or something to that effect). Preferably this would involve a more civilized method than "send keys"...

Can anyone help?
Microsoft PowerPointVisual Basic ClassicMicrosoft Development

Avatar of undefined
Last Comment
John Wilson

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
John Wilson

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23