none
How to get last modified time of mail (which is in composing mode) RRS feed

  • Question

  • HI All,

    We are writing a vsto plug-in. Our requirement was to save customized mail in draft on auto save. For this we had handled "BeforeAutoSave" event , did our changes and then set Cancel variable as true (Because we dont want to save normal mail in draft)

    Problem with this approach is that if user is drafting his mail from long time - might be he just left his machine, then after every 3 minutes (which is default auto save trigger time), it triggers "beforeAutoSave" as mail object is dirty for outlook. Therefore we again perform our customization action. It is definitely hitting our performance as well.

    We need some way so that I could identify that last modified time of mail opened in compose window, so that we could compare with time when we perform last customize action on that mail object and skip all stuff if mail is not modified.

    We had tried LastModifiedTime of mailItem but it giving some weird time (might be default value). Can some one please suggest any way to get it done ?

    Thanks

    Dev

     

    Thursday, March 7, 2019 3:17 AM

Answers

  • HI Dmitry,

    Thanks for reply. It was not possible as mail client was shared between other platform clients and thats why it could get modification from other platform also. However I have solved this case by calculating hash value of mail object and keep comparing it.

    Thanks

    Dev

    Monday, March 18, 2019 8:04 AM

All replies

  • Why not set a user property on the message?

    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/redemption
    Redemption - what the Outlook
    Object Model should have been
    Version 5.5 is now available!

    Thursday, March 7, 2019 3:51 PM
  • HI Dmitry,

    Thanks for reply. It was not possible as mail client was shared between other platform clients and thats why it could get modification from other platform also. However I have solved this case by calculating hash value of mail object and keep comparing it.

    Thanks

    Dev

    Monday, March 18, 2019 8:04 AM