Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to create a "search" button in a slide show

1,875 views
Skip to first unread message

Didier Rousselle

unread,
Dec 24, 2007, 10:56:00 AM12/24/07
to
I want to create a knowledge database in PowerPoint. I will use several entry
gates, some through hyperlinks created on on menu names located in the slide
show and directing the user to these menu after hitting the menu names. Next
to these menu names, I was wondering whether the knowledge data base user
could, without entering the edit mode (and therefore still whine in slide
show mode), click on a "search" button and enter the name of a topic he is
interested in.

Many thanks for your response.

Bill Dilworth

unread,
Dec 25, 2007, 12:00:59 AM12/25/07
to
Yes, but ...

There are much better tools for doing database work, really. PowerPoint is
a presentation software, and is not the most stable when it comes to keeping
data safe.

It is not a native function, so you will need to build the tool from the
ground up using VBA or other code. This means each function and field will
need to be defined, designed, coded, and debugged. This is not a small
project.

VBA does not work in the viewer, on machines without its software support
code installed, or on an user with Macro Security set to High or above.

If you do all this and run it on the right machine, it can be done.
However, I fear that the Wow factor with be somewhat less than the Oww
factor.


--
Bill Dilworth
A proud member of the Microsoft PPT MVP Team
Users helping fellow users.
http://billdilworth.mvps.org
-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
vestprog2@ Please read the PowerPoint FAQ pages.
yahoo. They answer most of our questions.
com www.pptfaq.com
.

"Didier Rousselle" <DidierR...@discussions.microsoft.com> wrote in
message news:080D9B69-7908-4A62...@microsoft.com...

rangana

unread,
Dec 25, 2007, 10:16:00 PM12/25/07
to
hi didier,

I am uncertain with this suggestion, but i'm hoping this will help. Why not
insert an input box and search button in your slide show then do work out
with the codes.
For example, if the user will key in "love" and love was in the 78th slide,
then the search button will navigate the user to the 78th slide. To insert an
input box and a search button, follow these steps: On the menu bar, click
View -> Toolbars then check the "Control Toolbox". In the control toolbox,
click the "textbox" button and insert it in your slide then click the
"command button". Please post back for whatever help I can offer.

thanks.

Haggistech

unread,
Jan 7, 2010, 12:16:05 PM1/7/10
to
I think he might be looking for the same thing as me, its easy to insert the
text box and the search button but the actual code to do the search is the
problem

i have managed to make all the text bold for example that i search for but i
cant work out how to make it jump to the page it finds the text on

Steve Rindsberg

unread,
Jan 7, 2010, 2:43:13 PM1/7/10
to
In article <DAC2FEC3-00B9-4B5A...@microsoft.com>, Haggistech wrote:
> I think he might be looking for the same thing as me, its easy to insert the
> text box and the search button but the actual code to do the search is the
> problem
>
> i have managed to make all the text bold for example that i search for but i
> cant work out how to make it jump to the page it finds the text on

Do you want to do this in normal editing view or in a slide show?

>
> "rangana" wrote:
>
> > hi didier,
> >
> > I am uncertain with this suggestion, but i'm hoping this will help. Why not
> > insert an input box and search button in your slide show then do work out
> > with the codes.
> > For example, if the user will key in "love" and love was in the 78th slide,
> > then the search button will navigate the user to the 78th slide. To insert an
> > input box and a search button, follow these steps: On the menu bar, click
> > View -> Toolbars then check the "Control Toolbox". In the control toolbox,
> > click the "textbox" button and insert it in your slide then click the
> > "command button". Please post back for whatever help I can offer.
> >
> > thanks.
> >
> > "Didier Rousselle" wrote:
> >
> > > I want to create a knowledge database in PowerPoint. I will use several entry
> > > gates, some through hyperlinks created on on menu names located in the slide
> > > show and directing the user to these menu after hitting the menu names. Next
> > > to these menu names, I was wondering whether the knowledge data base user
> > > could, without entering the edit mode (and therefore still whine in slide
> > > show mode), click on a "search" button and enter the name of a topic he is
> > > interested in.
> > >
> > > Many thanks for your response.


==============================
PPT Frequently Asked Questions
http://www.pptfaq.com/

PPTools add-ins for PowerPoint
http://www.pptools.com/


Haggistech

unread,
Jan 8, 2010, 6:19:02 AM1/8/10
to

"Steve Rindsberg" wrote:

> .
>

Within a slide show

If possible i want to have a search button will pop up a inputbox when
entered will take you to the first instance of the search and pop up a form
with a find next button

Steve Rindsberg

unread,
Jan 8, 2010, 12:20:34 PM1/8/10
to

> Within a slide show
>
> If possible i want to have a search button will pop up a inputbox when
> entered will take you to the first instance of the search and pop up a form
> with a find next button

It might be simpler to have the search button pop up a form in the first place with a
text box control for the "Find:" text and a "Find Next" button the user can click to
initiate the search and perhaps a "New Search" button they can use to "clear" the
search.

I've written a little function and some test code that'll do the bulk of the work.

You call the function once with just the search string as a parameter to find the first
ocurrence of the text; if found, it returns the index of the slide the text was found
on; zero otherwise.

For subsequent searches, you call the function with the same search text and two zeros
as parameters.

If for some reason you want to start searching at a slide or shape number other than 1
you can pass the starting numbers as parameters as well.

Note that since it only checks each shape once, it's only going to find a given search
string once per shape, even if the shape has more than one instance of the string.

The test routine's written to run in normal view. For slide show view, youd' want to
use:

SlideShowWindows(1).View.GoToSlide lTemp

instead

Option Explicit

Sub TestTheFunction()
Dim lTemp As Long

' find the first occurrence
lTemp = FindTheText("now")
If lTemp > 0 Then
ActiveWindow.View.GotoSlide lTemp
MsgBox "Click to continue"
End If

' find the next occurrence(s)
While lTemp > 0
lTemp = FindTheText("now", 0, 0)
If lTemp > 0 Then
ActiveWindow.View.GotoSlide lTemp
MsgBox "Click to continue"
End If
Wend

End Sub
Function FindTheText(sFindString As String, _
Optional lStartSlide As Long = 1, _
Optional lStartShape As Long = 1) As Long

' Returns the slide index of the slide the searchtext was found on
' if any

Dim oSl As Slide
Dim oSh As Shape
Dim x As Long
Dim y As Long

' Static vars to record highest previously searched
' slide and shape numbers
Static lSlideNum As Long
Static lShapeNum As Long

' are we starting a new search/resetting?
' if so, lStartSlide/lStartshape will both be 1
Select Case lStartSlide + lStartShape
Case 0
' we're continuing the search
' don't reset the counters
Case 2
' new search; reset both counters
lSlideNum = 1
lShapeNum = 1
Case Else
' we're starting from a specific position
lSlideNum = lStartSlide
lShapeNum = lStartShape
End Select

With ActivePresentation
For x = lSlideNum To .Slides.Count
Set oSl = .Slides(x)
With oSl
For y = lShapeNum To .Shapes.Count
Set oSh = .Shapes(y)
With oSh
If .HasTextFrame Then
If .TextFrame.HasText Then
If InStr(UCase(.TextFrame.TextRange.Text), _
UCase(sFindString)) > 0 Then
' FOUND ONE; record position
lSlideNum = x
lShapeNum = y + 1
' return slide index
FindTheText = oSl.SlideIndex
' and stop
Exit Function
End If ' Instr
End If ' Has text
End If ' has text frame
End With ' oSh
Next ' Shape
End With ' slide
lShapeNum = 1
Next ' slide
End With

' text not found, return 0
FindTheText = 0

End Function

Haggistech

unread,
Jan 22, 2010, 11:00:05 AM1/22/10
to

"Steve Rindsberg" wrote:

> .
>

I cant get this to work

Steve Rindsberg

unread,
Jan 22, 2010, 2:49:26 PM1/22/10
to


Oh.


Ah ... you wanted a more detailed answer than that? Try providing a more detailed
explanation of what "can't get this to work" means. ;-)

Haggistech

unread,
Jan 26, 2010, 4:06:11 AM1/26/10
to
Sorry

what should i be pulling the text from

in the function is that searching for the word "now"?

if i have a button to click to search how should i be calling the macro


Steve Rindsberg

unread,
Jan 26, 2010, 11:04:32 AM1/26/10
to
In article <25D138A2-24B6-4E63...@microsoft.com>,
Haggistech wrote:
> Sorry
>
> what should i be pulling the text from

Anyplace you need to. The code in sub TestTheFunction simply
demonstrates one way to call the function itself.

> in the function is that searching for the word "now"?

In this case, yes. It's just an example though.

> if i have a button to click to search how should i be calling the macro

The button's action setting could be Run Macro.

The macro/subroutine it runs could ask the user to type text to search
for using the InputBox command, for example, then use code similar to
what's in TestTheFunction to do the work.

0 new messages