L
Leanne
With the help of Sue's drag and drop sample code, I was able to get dragging
and dropping email to a form working in vb.net. The problem I am having is
getting the exchange recipient email address for another mailbox. I have the
code working to get the exchange users email addresses but it's failing when
a recipient is another mailbox. Here's the code I'm using. Thanks for any
assistance
Dim recipients As Outlook.Recipients = mail.Recipients
If recipients IsNot Nothing Then
Try
For i As Integer = 1 To recipients.Count
Dim recipient As Outlook.Recipient = recipients.Item(i)
If recipient IsNot Nothing Then
If recipient.Type = CInt(recipientType) Then
Dim entry As Outlook.AddressEntry =
recipient.AddressEntry()
If entry IsNot Nothing Then
Try
If entry.Type.ToString.ToUpper =
"EX" Then
If entry.getexchangeuser Is
Nothing Then
listBoxItems.Add(recipient.Name & "@somewhere.com") 'WORKS WITH THIS LINE
BUT IS THERE A BETTER WAY????
Else
listBoxItems.Add(entry.getexchangeuser.primarysmtpaddress())
End If
Else
listBoxItems.Add(entry.Address)
End If
End If
End If
End If
Next
End If
and dropping email to a form working in vb.net. The problem I am having is
getting the exchange recipient email address for another mailbox. I have the
code working to get the exchange users email addresses but it's failing when
a recipient is another mailbox. Here's the code I'm using. Thanks for any
assistance
Dim recipients As Outlook.Recipients = mail.Recipients
If recipients IsNot Nothing Then
Try
For i As Integer = 1 To recipients.Count
Dim recipient As Outlook.Recipient = recipients.Item(i)
If recipient IsNot Nothing Then
If recipient.Type = CInt(recipientType) Then
Dim entry As Outlook.AddressEntry =
recipient.AddressEntry()
If entry IsNot Nothing Then
Try
If entry.Type.ToString.ToUpper =
"EX" Then
If entry.getexchangeuser Is
Nothing Then
listBoxItems.Add(recipient.Name & "@somewhere.com") 'WORKS WITH THIS LINE
BUT IS THERE A BETTER WAY????
Else
listBoxItems.Add(entry.getexchangeuser.primarysmtpaddress())
End If
Else
listBoxItems.Add(entry.Address)
End If
End If
End If
End If
Next
End If