?
Solved

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

Posted on 2013-12-30
1
Medium Priority
?
664 Views
Last Modified: 2014-01-12
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?
0
Comment
Question by:RIBBIT_Productions
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 23

Accepted Solution

by:
JSRWilson earned 2000 total points
ID: 39761763
You could probably open and paste in text like this and "click" the button.

CommandBars.ExecuteMso ("FindDialog")
DoEvents
SendKeys ("^v")
DoEvents
CommandBars.ExecuteMso ("FindNext")

But why??

There will be all sorts of problems with losing focus on the search dialog and proesumably you have to click something to initiate "Find Next" so why not the find next button.
0

Featured Post

NFR key for Veeam Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction In all recent versions of PowerPoint it is possible to trigger animations. This means the animation takes place when a certain shape is clicked. This allows you to run animation “on demand” and outwith the normal sequence of mouse cl…
A lot of things can happen during a presentation, worst of which is “death by PowerPoint.” Here are a few mistakes to avoid to make your slides clean.
This video teaches viewers how to create handouts from their slides and helps them decide how many slides to include per handout.
The viewer will learn how to edit text. This includes Font, Spacing, Resizing, Color, and other special text options.

650 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question