Question Locked

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

0 helpful
2 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

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?

TJ

2 replies

by Member 25348569

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 :)

This discussion is closed to new replies.