Extracting CC Email Address Using VBA

Status
Not open for further replies.
E

ejek6337

Hello,

I have the current code that works for extracting various information from

the MailItem Object:

If itm.Class = olMail Then

Set msg = itm

objWks.Cells(i + 1, 1) = msg.Subject

objWks.Cells(i + 1, 2) = msg.ReceivedTime

objWks.Cells(i + 1, 3) = msg.SenderName

objWks.Cells(i + 1, 4) = msg.SenderEmailAddress

objWks.Cells(i + 1, 5) = msg.Body

objWks.Cells(i + 1, 21) = msg.CC

objWks.Cells(i + 1, 22) = msg.To

It is dumpting the data into an excel spreadsheet. I am able to extract the

sender email address with "SenderEmailAddress". Is there any possible way to

extract all the CC Email Addresses as well? The "CC" above only extracts the

name(s) in the field, not the actual email address. If there is not way to

do it I don't want to waste my time researching further. Thank you for any

information you can provide.

Ed
 

Michael Bauer

Senior Member
Outlook version
Outlook 2010 32 bit
Email Account
Exchange Server
See the Recipients collection, and check the type property of each recipient

object.

Best regards

Michael Bauer

Am Fri, 20 Nov 2009 12:14:01 -0800 schrieb ejek6337:


> Hello,

> I have the current code that works for extracting various information from
> the MailItem Object:

> If itm.Class = olMail Then
> Set msg = itm
> objWks.Cells(i + 1, 1) = msg.Subject
> objWks.Cells(i + 1, 2) = msg.ReceivedTime
> objWks.Cells(i + 1, 3) = msg.SenderName
> objWks.Cells(i + 1, 4) = msg.SenderEmailAddress
> objWks.Cells(i + 1, 5) = msg.Body
> objWks.Cells(i + 1, 21) = msg.CC
> objWks.Cells(i + 1, 22) = msg.To

> It is dumpting the data into an excel spreadsheet. I am able to extract


the
> sender email address with "SenderEmailAddress". Is there any possible way


to
> extract all the CC Email Addresses as well? The "CC" above only extracts


the
> name(s) in the field, not the actual email address. If there is not way


to
> do it I don't want to waste my time researching further. Thank you for


any
> information you can provide.

> Ed
 
E

ejek6337

Thanks a million. The recipients object worked like a charm. I knew I was

just overlooking something. Thanks for the direction.

Ed

"Michael Bauer " wrote:



> See the Recipients collection, and check the type property of each recipient
> object.

> > Best regards
> Michael Bauer

> > >

> Am Fri, 20 Nov 2009 12:14:01 -0800 schrieb ejek6337:
>
> > Hello,
> > I have the current code that works for extracting various information from
> > the MailItem Object:
> > If itm.Class = olMail Then
> > Set msg = itm
> > objWks.Cells(i + 1, 1) = msg.Subject
> > objWks.Cells(i + 1, 2) = msg.ReceivedTime
> > objWks.Cells(i + 1, 3) = msg.SenderName
> > objWks.Cells(i + 1, 4) = msg.SenderEmailAddress
> > objWks.Cells(i + 1, 5) = msg.Body
> > objWks.Cells(i + 1, 21) = msg.CC
> > objWks.Cells(i + 1, 22) = msg.To
> > It is dumpting the data into an excel spreadsheet. I am able to extract

> the
> > sender email address with "SenderEmailAddress". Is there any possible way

> to
> > extract all the CC Email Addresses as well? The "CC" above only extracts

> the
> > name(s) in the field, not the actual email address. If there is not way

> to
> > do it I don't want to waste my time researching further. Thank you for

> any
> > information you can provide.
> > Ed

> .
>
 
Status
Not open for further replies.
Thread starter Similar threads Forum Replies Date
B Extracting email addresses from a folder - how to also get the name of the person the address is for? Using Outlook 5
Z Default VBA code for extracting data from email (Outlook) to Excel? Outlook VBA and Custom Forms 1
M Oh please read---> Extracting email web leads on to excel spread sheet Using Outlook 3
J Need Help Extracting Email Content into Excel Specifically the Attachment Name Using Outlook 3
D Outlook VBA error extracting property data from GetRules collection Outlook VBA and Custom Forms 10
O Extracting all mail addresses from all folders Using Outlook 10
M Extracting cell data from table Outlook VBA and Custom Forms 2
A Extracting only one recipient from Msgitem.To Outlook VBA and Custom Forms 7
V Extracting user-defined details from a public folder Outlook VBA and Custom Forms 2
D Extracting Location info from All Day Event in mailboxes into webpage Exchange Server Administration 3
K Extracting Calendar information from a OST file? Exchange Server Administration 5
W September 2020 - No Default Email Client message after Office Update Using Outlook 0
glnz O365 - How to combine the Inboxes for four email accounts into a single Inbox Using Outlook 7
glnz O365 - How to send from acct 2 but showing email name from acct 1 as From - alias? Using Outlook 1
S Macro to move “Re:” & “FWD:” email recieved the shared inbox to a subfolder in outlook Outlook VBA and Custom Forms 0
D Move Email with Attachment to Folder Outlook VBA and Custom Forms 3
E Asking user to select multiple options in a list in an email Outlook VBA and Custom Forms 0
K Use VBA to find Sender and Recipient from Microsfot 365 Journaled Email Items Outlook VBA and Custom Forms 3
B Add ComboBox Value to Body of Email Outlook VBA and Custom Forms 1
A Backup Email Accounts On OutLook For Mac 2016 (Microsoft 365 subscription version) Using Outlook 0
F VBA code to dock Styles whenever I write or edit an email Outlook VBA and Custom Forms 0
G Inbox shows old email Using Outlook 3
L Email with correct To address but displaying name of a related person Using Outlook 0
A Two Inboxes, Same Email? Using Outlook 3
B Adding signature to bottom of VBA reply email Outlook VBA and Custom Forms 1
J To delete the draft email Using Outlook 2
B VBScript doesn't run on Recipient Email Outlook VBA and Custom Forms 2
J Autoreply email recieved from specific sender after deleting some text from body. Using Outlook 0
M Outlook 2013 reminder email by using Outlook vba Outlook VBA and Custom Forms 2
D Sending email from Office 365 alias in Outlook Using Outlook 3
S Macro or plug-in to see if specific person was included in this email Outlook VBA and Custom Forms 3
S Body text of Email from invite date/time Outlook VBA and Custom Forms 7
R Outlook 2010 How do you export 2 email Accounts' 2010 Inbox Files to new computer (2019)? Using Outlook 0
R Auto display of new email does not work on non-default account Outlook VBA and Custom Forms 0
J Automatically forward email and apply template Outlook VBA and Custom Forms 0
L Outlook saved email templates Using Outlook 1
B VBA to convert email to task, insert text of email in task notes, and attach copy of original email Outlook VBA and Custom Forms 4
T How can you include Junk Email in Search Results like you can include Deleted Items? Using Outlook 3
W Replyin to the reply-to email address Outlook VBA and Custom Forms 0
E How to display "Change Folder" in Change Default Email Delivery Location in Exchange Outlook 2016 Using Outlook 1
M Extract all links from Outlook email, send to Excel Using Outlook 2
O Forward a email with modified body Automatically. Outlook VBA and Custom Forms 0
B Outlook 2003 email sending & receiving suddenly stopped working Using Outlook 3
R List folders in a combo box + select folder + move emails from inbox to that folder + reply to that email Outlook VBA and Custom Forms 1
O Email not leaving Outbox when using Excel VBA to sync Outlook account Outlook VBA and Custom Forms 4
T The non-email functions Using Outlook 8
P Outlook 2013 Word Share doc as Email Attachment now brings up Eudora. Using Outlook 1
C How to rename subject line and forward the email Outlook VBA and Custom Forms 2
R Help Revising VBA macro to delete email over different time span Outlook VBA and Custom Forms 0
J Sent Items Folder NOT Showing Correct From Email Address Using Outlook 0
Similar threads


















































Top