Hello once again,
I have a listview which contains 4 items, with their subitems. I have multiselect set to true. If the end user choose three items, how can I go about getting the column 1 and 2 information for each item? I know it's going to be a "For each", but I haven't used "For each" blocks must? Would I have to put the selected information into a list first, then for each? Any help would be appreciated. Thank you.
Kevin
Loading
Mittal SejpalPosted Aug 30, 2011, 2:12 AM
Hope it might help you
Kevin DavisPosted Aug 30, 2011, 9:47 AM
(Code on my form)
ElseIf checkboxAddContactName.Checked = True Then
Dim z As New contact
For i = 0 To ListView1.Items.Count - 1
If ListView1.SelectedItems.Count > 1 Then
z.Name = ListView1.SelectedItems(0).Text
z.Email = ListView1.SelectedItems(0).SubItems(1).Text
End If
Next
z.SendEmail()
Close()
Else
Dim z As New contact
z.Email = ListView1.SelectedItems(0).SubItems(1).Text
z.SendEmail()
Close()
End If
(Code in the contact class)
Public Sub MultipleEmail()
If frmContacts.ListView1.SelectedItems.Count > 1 Then
For i = 0 To frmContacts.ListView1.Items.Count - 1
If frmContacts.ListView1.SelectedItems.Count > 1 Then
Name = frmContacts.ListView1.SelectedItems(i).Text
Email = frmContacts.ListView1.SelectedItems(i).SubItems(1).Text
frmPOP.Instance.txtEmailTo.Text = "<" & Email & "> " & Chr(34) & Name & Chr(34)
End If
Next
End If
End Sub