Article ID: 112384
Article Last Modified on 12/9/2003
Sub cGroups_Click ()
Dim sGroups As String
Dim pos As Integer
On Error GoTo GError
tGroups.LinkMode = 0
tGroups.LinkTopic = "Progman|Progman"
tGroups.LinkMode = 2
tGroups.LinkItem = "groups"
tGroups.LinkRequest
' Parse groups that come back:
sGroups = tGroups.Text
pos = InStr(1, sGroups, Chr(13))
While pos
ComGroups.AddItem RTrim$(Mid$(sGroups, 1, pos - 1))
sGroups = LTrim$(Mid$(sGroups, pos + 2))
' The + 2 on the previous line gets past the line feed chr(10)
pos = InStr(1, sGroups, Chr(13))
Wend
' Select first member in combo box:
ComGroups.ListIndex = 1
GDone:
tGroups.LinkMode = 0
Exit Sub
GError:
MsgBox "Error in getting groups"
Resume GDone
End Sub
Sub cItems_Click ()
Dim sItems As String
On Error GoTo IError
' Clear the combo box:
ComItems.Clear
If (Len(ComGroups.Text)) Then
tItems.LinkMode = 0
tItems.LinkTopic = "Progman|Progman"
tItems.LinkMode = 2
tItems.LinkItem = ComGroups.Text
tItems.LinkRequest
' Parse items that come back:
sItems = tItems.Text
pos = InStr(1, sItems, Chr(13))
While pos
ComItems.AddItem RTrim$(Mid$(sItems, 1, pos - 1))
sItems = LTrim$(Mid$(sItems, pos + 2))
' The + 2 on the previous line gets past the line feed chr(10)
pos = InStr(1, sItems, Chr(13))
Wend
End If
' Select first member in combo box:
ComItems.ListIndex = 1
IDone:
tItems.LinkMode = 0
Exit Sub
IError:
MsgBox "Error in getting items"
Resume IDone
End Sub
Additional query words: 1.00 2.00 3.00 interop icon
Keywords: KB112384