In VBA for PowerPoint 2010, how do I use the built-in "Find" dialog's "Find Next" function?
Posted on 2013-12-30
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:
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:
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?