-
Any suggestions on how to check for multiple selected items in a ListBox and pass each value to a MAPI control.
I have no problem picking one item and this being passed correctly, but I'm having problems with multiple selection of items. I have been fighting with a For-Next loop trying to test each value as selected or not. Any sample code would be much appreciated.
Sincerely,
-
Here's an example that copies all the checked items from a ListBox to a ComboBox when you click a CommandButton. :rolleyes:
Requires: A ListBox with Style = 1 (Checked), a ComboBox with Style = 2 (Dropdown List) and a CommandButton.
Code:
Private Sub Command1_Click()
Dim I As Integer
Call Combo1.Clear
For I = 0 To List1.ListCount - 1
If List1.Selected(I) Then Call Combo1.AddItem(List1.List(I))
Next
End Sub
Private Sub Form_Load()
Dim I As Integer
For I = 1 To 10
Call List1.AddItem("Item " & I)
Next
End Sub