Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to read only new content in VSTO Outlook MailItem body?

I've written a little C# VSTO add-in for Outlook 2003 that reads the body of emails as they are being sent, looking for certain words. It's working right now to do this:

if (currentItem.Body.Contains("text to search for"))

... but that checks the entire email body, not just the new message being sent.

Is there anyway to have Outlook just check the contents of the new message being sent, and so ignore the older email chain that might be in there too?

These messages could be in any format (HTML, Rich Text, Plain Text) and may or may not have any earlier messages chained in. This is just a productivity tool for me, so any hack that works is worth considering here.

Thanks!

like image 312
Peter Avatar asked Nov 06 '22 17:11

Peter


1 Answers

@Corbin March has the best answer here Separate a multipart email using Mime Parsers

like image 60
Jeremy Thompson Avatar answered Nov 14 '22 15:11

Jeremy Thompson