I am creating a MultiSelect listbox in Word 2003 and when the listbox is displayed, some of the items in the listbox are preselected and I have not been able to find out why. I do not want anything preselected. In my main module I have the following code:
And the form always opens with at least 2 items in the list already selected. I have tried adding the following line right after the additem line, as the last line in the loop, and in the form initialze sub, but it still shows the items selected.
One quirk I have noticed, if I step through the code line-by-line, it works correctly. But if I run through it, it displays with some items preselected.
Any ideas?
Code:
For i = 1 to FundNumber
FundForm.ListBox1.AddItem i
FundForm.ListBox1.List(i - 1, 1) = MFLFundName(i)
FundForm.ListBox1.List(i - 1, 2) = MFLTicker(i)
FundForm.ListBox1.List(i - 1, 3) = MFLShareClass(i)
FundForm.ListBox1.List(i - 1, 4) = FundNote(i)
Next i
FundForm.ListBox1.MultiSelect = fmMultiSelectMulti
FundForm.Show
And the form always opens with at least 2 items in the list already selected. I have tried adding the following line right after the additem line, as the last line in the loop, and in the form initialze sub, but it still shows the items selected.
Code:
FundForm.ListBox1.Selected(i - 1) = False
One quirk I have noticed, if I step through the code line-by-line, it works correctly. But if I run through it, it displays with some items preselected.
Any ideas?