Basic Combobox in PowerPoint 2003

  • Thread starter Thread starter cgrier
  • Start date Start date
C

cgrier

All,

Sorry, I have read many posts but can't seem to find the one that fits
my very basic need. All I want to do is create a combobox on my slide
that allows the viewer to choose from three choices. Below is the
code I have so far which I found on one of the postings on this
website:

Sub LoadCombo()
ComboBox1.Clear
With ComboBox1
.AddItem "First Slide"
.AddItem "Second Slide"
.AddItem "Third Slide"
End With
End Sub

The challenge I am having is that when you are in the slideshow and
you choose "First Slide" from the dropdown the number 0 appears in the
combobox. Same for the other choices, expect you get the number 1 or
2 depending on your choice. How do I get the text to replace the
number after the view has selected it?

Thank you!

Cgrier
 
OK, I think I have made a little progress. If I go into this code and
run it BEFORE going into the slideshow I can see all my choices in
text and once chosen they appear in text. So problem one solved.
However, when I close the ppt file and then reopen it and run the
slideshow I can no longer see the choices in the dropdown box. I have
to go back and run this code again in order to be able to see the
choices. How can I fix this so that the choices are always there when
the file is opened and the slideshow is run?

Thanks!!!!

cgrier
 
Hi,
I have the same problem as Cgrier. I closed the presentation and when
I reopend it and started the slideshow there wasn't text. I wrote the
code again but the text didn't appear. I selected Tools/Macro/Macros
but there isn't LoadCombo. What I suppouse to do?
Please, help me!
 
I can't open it

Here is what worked for me.

You have to have a SUB (NOT A PRIVATE SUB) as a macro that adds these
items to your combo box every time you initiate the slide show. What
I did was place an object covering the entire slide into the first
slide, chose the action setting, and then told it to run macro under
mouse over. That way every time I open the slide show and move my
mouse on the first slide it initiates the macro and adds all the items
to the comboboxes.

Here is my overall code, see if this helps:

Sub Initialize()
Dim Combo1 As ComboBox
Set Combo1 =
ActivePresentation.Slides(2).Shapes("ComboBox1").OLEFormat.Object

Dim i As Integer
For i = 1 To Combo1.ListCount
Combo1.RemoveItem 0

With Combo1
.AddItem "Test1", 0
.AddItem "Test2", 1
.AddItem "Test3", 2
.AddItem "Test4", 3
.AddItem "Test5", 4
.AddItem "Test6", 5
.AddItem "Test7", 6
End With

End Sub

NOTE: MAKE SURE YOU HAVE THE CORRECT SLIDE NUMBER ENTERED IN LINE
THREE OF THIS CODE!

Enter a private sub change if you want something to happen after the
user make a selection from your combobox list. Use the INDEX for
this.

Later,

cgrier
 
OK, I think I have made a little progress. If I go into this code and
run it BEFORE going into the slideshow I can see all my choices in
text and once chosen they appear in text. So problem one solved.
However, when I close the ppt file and then reopen it and run the
slideshow I can no longer see the choices in the dropdown box. I have
to go back and run this code again in order to be able to see the
choices. How can I fix this so that the choices are always there when
the file is opened and the slideshow is run?

Save the PPT file before closing it
 
Back
Top