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
651 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 500 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

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
How to make an ADE file by code? 11 99
Zip Folders Using Chilkat Routines 1 75
Excel Automation VBA 19 104
Mobile apps - web/native or hybrid? 1 69
Outline From PowerPoint 2010 it is possible to have shapes appear in front of video, in earlier versions video always played in front of other shapes. This means it is possible to have captions animated to appear in front of video. Users who h…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
The viewer will learn how to edit animations within the presentation, incorporate sound, and set everything up with timing.
The viewer will learn how to  create a slide that will launch other presentations in Microsoft PowerPoint. In the finished slide, each item launches a new PowerPoint presentation and when each is finished it automatically comes back to this slide: …

749 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