Message 1 of 3
How to Pre-Select items in a Multi-select listbox????

Not applicable
05-22-2001
10:12 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I have code that "Should" upon loading the form check to see if toolbars are
loaded:
'cycle through the toolbars and add the appropriate menus to the lisbox
For Each objToolBar In objMenuGroup.Toolbars
strToolbarID = objToolBar.TagString
strCompare = Mid(strToolbarID, 1, IDLength)
If strCompare = strID Then
strToolbarName = objToolBar.Name
ListBox1.AddItem (strToolbarName)
Set objToolBar = objMenuGroup.Toolbars(strToolbarName)
If objToolBar.Visible = True Then
ListBox1.Selected(strToolbarName) = True
End If
Else
MsgBox "something is wrong"
End If
Next
Except no actual item in the multi - select listbox gets selected. How do i
select something through code.
loaded:
'cycle through the toolbars and add the appropriate menus to the lisbox
For Each objToolBar In objMenuGroup.Toolbars
strToolbarID = objToolBar.TagString
strCompare = Mid(strToolbarID, 1, IDLength)
If strCompare = strID Then
strToolbarName = objToolBar.Name
ListBox1.AddItem (strToolbarName)
Set objToolBar = objMenuGroup.Toolbars(strToolbarName)
If objToolBar.Visible = True Then
ListBox1.Selected(strToolbarName) = True
End If
Else
MsgBox "something is wrong"
End If
Next
Except no actual item in the multi - select listbox gets selected. How do i
select something through code.