Damian
Damian

Reputation: 1364

How to get last reply of a MailItem from Outlook in C#?

I want to get the last reply in an Outlook Conversation from a MailItem. I don't want to get the whole mail.

I tried to get the messages of MailItem but I couldn't, every time I got the whole email, not only the last reply.

Outlook.MailItem item = Items.GetLast();
MessageBox.Show(item.Body);

I expected to get only the last reply message from the mail thread but I got the whole mail instead!

Upvotes: 1

Views: 534

Answers (1)

Dmitry Streblechenko
Dmitry Streblechenko

Reputation: 66215

It is your responsibility to parse the message body and extract the latest text. Keep in mind that you might not be able to do that since nothing prevents the user from typing inside the previous replies rather than only at the top (or bottom) of the message.

Upvotes: 1

Related Questions