Solved

Retrieve email addresses from an email in outlook

Posted on 2008-06-17
1
561 Views
Last Modified: 2013-11-26
Hi all,
   I am developing an outlook addin in vb.net using VSTO. I am trying to retrieve information from an email and I can do everything fine except retrieving email addresses. I can easily get the senders email by using the .senderEmailAddress but this does not exsist for to,cc,bcc. When I use to,cc, or bcc only the persons name comes up and not the email address. Would anyone have a way of getting around this? Below is a smaill snippet of code:


Thanks In Advance

Dim objApp As Outlook.Application

            Dim msg As Outlook.MailItem

            objApp = CreateObject("Outlook.Application")

            msg = objApp.ActiveInspector.CurrentItem

            Me.txtSubject.Text = msg.Subject

            Me.txtNotes.Text = msg.Body

            Me.txtFromEmail.Text = msg.SenderEmailAddress

Open in new window

0
Comment
Question by:yazbek
1 Comment
 
LVL 47

Accepted Solution

by:
Wayne Taylor (webtubbs) earned 250 total points
ID: 21810900
Use the Recipients collection.....
    Dim rpt As Recipient

    For Each rpt In msg.Recipients

        'Recipient.Type enum values in comments

        Select Case rpt.Type

            Case olBCC '3

                MsgBox "BCC Recipient Address = " & rpt.Address

            Case olCC '2

                MsgBox "CC Recipient Address = " & rpt.Address

            Case olTo '1

                MsgBox "TO Recipient Address = " & rpt.Address

        End Select

    Next

Open in new window

0

Featured Post

Control application downtime with dependency maps

Visualize the interdependencies between application components better with Applications Manager's automated application discovery and dependency mapping feature. Resolve performance issues faster by quickly isolating problematic components.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Microsoft Outlook provides an easy way to recover permanently deleted items. When you empty the Deleted Items or simply deleted an Outlook data items using shift+Del key then it can be recovered using Registry Key settings.  Caution- Wrong Registry…
Explore the encryption capabilities built into Google Apps and how these features can help you meet privacy policy and regulatory compliance, but are not a full solution. Understand and compare the most popular email encryption services for Google A…
The purpose of this video is to demonstrate how to set up a Mailchimp Template which will let the user create a uniform look for all of their campaigns. This will be demonstrated using a Windows 8 PC. Mailchimp will be used. Log into your Mail…
This Micro Tutorial demonstrates  how Internet marketers work with competitive analysis data, and a common task in data preparation is creating separate column for domains. You will then extract from a list of URLs.

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now