A quick question: referencing to the "parent" of a message

  • Thread starter Thread starter Jonathan Orlev
  • Start date Start date
J

Jonathan Orlev

Hello everybody,

I am completely new to the subject of Outlook automation (although I
have a little experience in Word automation).

I have a problem, and I hope can help me.

I want to ask if for a given message that was created by the user (not
yet sent), which is a _reply_ or a forward to a _parent_ message, I can
get the email address of the sender of the _parent_ message.

for example, If a user is replying to a message send by (e-mail address removed), and I
have a reference to the message this user is writing, how can I get the
address (e-mail address removed) ?

Is it possible ?

Any reply will be appreciated. If this is not possible, the closest
thing I can do is probably look for the first instance of the 'From: '
line in the body of the reply, in hope to find this 'From: (e-mail address removed)'
line.

Regards,

Jonathan Orlev
(e-mail address removed)
 
You can get the To field of the item but that might have display names
rather than actual SMTP addresses. You could also get the Recipients
collection and check each Recipient.Address. You will get the security
prompts with either method in secure versions of Outlook however.

Matching an item with previous items in a conversation can be done by
checking MailItem.ConversationTopic and .ConversationIndex.
 
Hello Ken,

ThanQ very much for your answer.

About the Recipients collection:
This will not work, I think, because the message I am processing is a
new message created by the user. Therefore, I cannot find the name of
the person who sent it to him using the recipients collation, because I
cannot assure that he is replying to the same exact person.

As for the MailItem.ConversationIndex: this is definitely something I
will need to check.

Until then, I have created a function that extract's the XXX string from
the 'From: XXX' line in the message. It seems to be working quite right.


Regards and thanks again,

Jonathan Orlev
(e-mail address removed)
 
Back
Top