A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Reading another mailbox Address



 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old March 31st 10, 12:16 AM posted to microsoft.public.outlook.program_vba
Leanne
external usenet poster
 
Posts: 1
Default Reading another mailbox Address

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 & ") 'WORKS WITH THIS LINE
BUT IS THERE A BETTER WAY????
Else

listBoxItems.Add(entry.getexchangeuser.primarysmtp address())
End If

Else
listBoxItems.Add(entry.Address)
End If

End If
End If

End If
Next

End If
 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Reading SMTP address from Exchange Sender mail address VebKol Outlook and VBA 4 March 6th 09 04:08 PM
Outlook address books reading (C++). Sergeichik Add-ins for Outlook 1 December 5th 08 04:48 PM
Reading windows user's email address John[_11_] Outlook - General Queries 5 June 2nd 08 05:47 PM
Reading windows user's email address John[_11_] Outlook and VBA 5 June 2nd 08 05:47 PM
How to add the contact in the additional mailbox show in address b Tony Outlook - Using Contacts 1 March 10th 06 06:05 PM


All times are GMT +1. The time now is 06:27 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.