How to get the 'TO' address from a current mesage using CDOSession.getmsg

By tj ·
Hi All!

Quick question, I'm hoping I'm being blind. We're currently running a script on our outlook that generates tasks etc for certain mails coming in. We need to add criteria to ignore a certain address though.

Currently the sender address works:
Set CDOSession = EventDetails.Session
Set CurItem = CDOSession.GetMessage(EventDetails.MessageID,Null)

'*** Determine who message is from
Set objSender = CurItem.Sender
strSenderName = objSender.Name
strSenderAddress = objSender.Address

What I need to do is create something like this:

Set ObjTo = CurItem.Recipient
StrSenderTo = ObjTo.Address

However I can't find the tag to get the 'To' address.

Any ideas?


This conversation is currently closed to new comments.

Thread display: Collapse - | Expand +

All Answers

Collapse -

Download and install a demo copy of Outlook Spy

by neilb@uk In reply to How to get the 'TO' addre ...

It will last long enough for you to record all of the tags that you'll ever need.

The problem with the Recipients field is that it's an array of all recipients. I'm not sure about this as I haven't scripted Outlook for ages, but try objTo.To as that return a string. Multiple intended recipients are semi-colon separated.

Neil :)

Related Discussions

Related Forums