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.
Similar threads
Thread starter Title 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
A VBA Script - Print Date between first email in Category X and last email in Category Y Outlook VBA and Custom Forms 3
P Sending email from outlook IMAP to GMAIL where embedded images are added as attachment Using Outlook 1
D auto forward base on email address in body email Outlook VBA and Custom Forms 0
P How did hacker cause link to delete and archive containing email? Using Outlook 6
I 'quote marks' around email name Using Outlook 1
N contact list seen in Contact folder but knot in Address book or when 'TO' button is clicked in new email Using Outlook 0
T Junk Email does not get added to the Blocked Sender List Using Outlook 0
P i-Phone 6s Plus receiving 2 notifications from Outlook email Using Outlook 1
C WARNING - DO NOT USE AN OUTLOOK.COM ADDRESS FOR GOOGLE ACCOUNT RECOVERY EMAIL Using Outlook 10
T Why is every new email pinned (to keep it on top)? Windows 10 Using Outlook 6
M Outlook, send to > mail recipient - results in plain text email Using Outlook 1
P Can I create a Rule that sends me an email when I get a Task? Using Outlook 3
M Issue transferring Outlook 2016 email accounts & settings onto new computer Using Outlook 8
R Auto Assign Category colours to Incoming Emails based on whom the email is addressed Outlook VBA and Custom Forms 3
S Outlook email to configure setup for each mail Outlook VBA and Custom Forms 1
S Macro to extract email addresses of recipients in current drafted email and put into clipboard Outlook VBA and Custom Forms 2
A Is there an ID field you can use to pair a reply to the sent email? Outlook VBA and Custom Forms 4
C Auto Run VBA Code on new email Outlook VBA and Custom Forms 1
M How create a Rule to filter sender's email with more that one @ sign Using Outlook 1
A Prepending Email Addrs with "Display Name <email>" Has Stopped Working Using Outlook 0
Bering Forward selected email without the original email appended Outlook VBA and Custom Forms 0
Aussie Rules Run a Script on an Incoming Email OK and then the Email reverts Outlook VBA and Custom Forms 0
W Reply to email Using Outlook 4
F Junk Email does not get added to the Blocked Sender List Using Outlook 4
B disappearing original when attach to email Using Outlook 1
W September 2020 - No Default Email Client message after Office Update Using Outlook 1
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 0
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

Similar threads

Top