[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Retrieve email addresses from an email in outlook

Posted on 2008-06-17
1
Medium Priority
?
571 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 48

Accepted Solution

by:
Wayne Taylor (webtubbs) earned 1000 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

This is my first article on Expert Exchange on the Manual Method of Exporting Office 365 Mailboxes to PST format by using the eDiscovery mechanism of Office. Hope you will enjoy the article.
Are you an Exchange administrator employed with an organization? And, have you encountered a corrupt Exchange database due to which you are not able to open its EDB file. This article will explain all the steps to repair corrupt Exchange database.
The purpose of this video is to demonstrate how to set up Lists in Mailchimp. This will be demonstrated using a Windows 8 PC. Mailchimp will be used. Log into your Mailchimp account. : Click on Lists. Click on Create List Button : Choose the desi…
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
Suggested Courses

650 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