I
Ian
Using Word 97.
A very basic VBA question.
I am using AddItem to place items from a string array into a combo box
list:
~~~~~~~~~~~~~~
mystring(1) = "qwerty"
mystring(2) = "asdfgh"
.....
mystring(10) = "mnbvcx"
With MyForm
For n = 1 to 10
.myComboBox.AddItem mystring(n)
Next
~~~~~~~~~~~~~~~
This works fine. When I click on the scroll bar, the list of items
appears.
However, at a later time, I want to re-load the box with a different
list. But if I use similar code to the above, the new items are *added*
to the original list. I just want to *replace* the original list.
The question then is: How do I remove the original items before adding
new ones?
A very basic VBA question.
I am using AddItem to place items from a string array into a combo box
list:
~~~~~~~~~~~~~~
mystring(1) = "qwerty"
mystring(2) = "asdfgh"
.....
mystring(10) = "mnbvcx"
With MyForm
For n = 1 to 10
.myComboBox.AddItem mystring(n)
Next
~~~~~~~~~~~~~~~
This works fine. When I click on the scroll bar, the list of items
appears.
However, at a later time, I want to re-load the box with a different
list. But if I use similar code to the above, the new items are *added*
to the original list. I just want to *replace* the original list.
The question then is: How do I remove the original items before adding
new ones?