Combo Boxes

A

anonymous

Hi, I'm not sure if this is the right group to ask this question but if
it isn't can someone tell me the right newsgroup to go to. So whenever
I try to use this code to make a combo box with the items "Test" and
"Test 2" it shows more than one of each item. Here is the code:

Public Sub InitListBox()
ComboBox1.AddItem "Test", 1
ComboBox1.AddItem "Test 2", 2
End Sub

or

Public Sub Auto_Open()
ComboBox1.AddItem "Test", 1
ComboBox1.AddItem "Test 2", 2
End Sub
 
B

Bill Dilworth

Try adding a
ComboBox1.Clear
before your code adds stuff.


--
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
..
 
A

anonymous

I tried:

Public Sub InitListBox()
ComboBox1.Clear
ComboBox1.AddItem "Test", 1
ComboBox1.AddItem "Test 2", 2
End Sub

and

Public Sub Auto_Open()
ComboBox1.Clear
ComboBox1.AddItem "Test", 1
ComboBox1.AddItem "Test 2", 2
End Sub

but now there is nothing in the combo box
 
B

Bill Dilworth

A trick I use for this ...

....create a rectangle behind the ComboBox that is a bit bigger than the
combo box. Then add this macro:

Sub LoadComboBox()
If ComboBox1.LineCount < 2 Then
ComboBox1.Clear
ComboBox1.AddItem "Test", 1
ComboBox1.AddItem "Test 2", 2
End If
End Sub

Then set the MouseOver action setting on the rectangle to run the macro.


--
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
..
 
B

Bill Dilworth

Rectangle tool on the drawing toolbar (usually across the bottom of the edit
pane between the arrow and circle tools).

To move it behind the combo box, right click on the rectangle and select
Order=> Move backwards (repeat until combo box is on top).


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