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.
Top