P
patrick.sparks
Hi all,
I'm having issues with the selection property of the outlook view
control. The view control will show a contact view from a public
folder. When selecting the contact, I would like to set the selected
contact (or if multiple contacts selected, the first selected contact)
to a currentContact variable in the app. I can't get the selection
property to do much of anything for me. It will pick up the number of
selected items, but (as you see below), I never receive a messagebox
for each individual selection. Here's my code. Any suggestions are
appreciated.
Private Sub Contacts_SelectionChange(ByVal sender As Object, ByVal e As
System.EventArgs) _
Handles vcContacts.SelectionChange
Dim selection As Outlook.Selection = vcContacts.Selection
Dim oContact As Outlook.ContactItem
Dim oPrp As Outlook.ItemProperty
Dim i As Integer
MessageBox.Show("# contacts: " & selection.Count)
For i = 0 To selection.Count - 1
oContact = selection.Item(i)
MessageBox.Show(oContact.FirstName)
Next
I'm having issues with the selection property of the outlook view
control. The view control will show a contact view from a public
folder. When selecting the contact, I would like to set the selected
contact (or if multiple contacts selected, the first selected contact)
to a currentContact variable in the app. I can't get the selection
property to do much of anything for me. It will pick up the number of
selected items, but (as you see below), I never receive a messagebox
for each individual selection. Here's my code. Any suggestions are
appreciated.
Private Sub Contacts_SelectionChange(ByVal sender As Object, ByVal e As
System.EventArgs) _
Handles vcContacts.SelectionChange
Dim selection As Outlook.Selection = vcContacts.Selection
Dim oContact As Outlook.ContactItem
Dim oPrp As Outlook.ItemProperty
Dim i As Integer
MessageBox.Show("# contacts: " & selection.Count)
For i = 0 To selection.Count - 1
oContact = selection.Item(i)
MessageBox.Show(oContact.FirstName)
Next