how to detect if a certain word in the body is before the signature / "orignal mail"

Add-in Express™ Support Service
That's what is more important than anything else

how to detect if a certain word in the body is before the signature / "orignal mail"
 
Tim Smet




Posts: 12
Joined: 2015-10-06
Hi,

We use the adxOutlookAppEventsItemSend event to detect if a certain word in the email is written ("attachment"). If this is the case and there are no "real" attachments present we ask the user if he is sure to send the email while he mentioned "attachment" yet no attachments are present. (if they say no we set cancel to true).

Now the problem:
While typing an email and saveing the mail (before sending) and then looking at PR_HTML of the email (or htmlbody) you'll see it contains word html css etc from office (word) as well as _MailAutoSig bookmark when there is a signature added or _orignalmail bookmark. We thought we could use these to limit the searching area for the word "attachment" to only what the user had typted in his current email and ignore attachments or original mails when using forward / reply.

The problem is the html is changed while being in the itemsend event it does not contain those bookmarks anymore. The html has been converted from office like html to regular html as is suggested here: https://social.msdn.microsoft.com/Forums/office/en-US/af4a6ece-d9a3-485e-a087-3e7bdf70d6a5/mailautosig-bookmark-missing-outlook-2010?forum=outlookdev


How should this be done so that we ignore the text from signature / original mails if the html is already changed in itemsend event and those bookmarks don't exist anymore?

thanks
Posted 22 Mar, 2017 10:48:12 Top
Dmitry Kostochko


Add-in Express team


Posts: 2731
Joined: 2004-04-05
Hi Tim,

I am afraid you can detect where the original email body begins only by using indirect indications. For example, you can try to search for the "From:" text wrapped into <b></b> tags, or search for text that the ConversationTopic property contains. One more option to try is the received date of the original email, this information is also added to the header of the original email.
Posted 23 Mar, 2017 04:45:59 Top