none
How can I determine which machine originated an Outlook event? RRS feed

  • Question

  • Hi,

      I have a client who asked me to develop an add-in that warns the user when she moves a folder (the idea being that the user needs to be aware of the corporate backup policies).

      I developed the add-in and the client deployed it.

      However, there is an issue where the user is a delegate for her boss.  When her boss moves a folder, she sees the prompt as well (since the store's OnMovedFolder3 is the event that is trapped).  I do not want the delegate's Outlook to prompt, because it was the boss that initiated the move.  Unfortunately, information about the machine that originated the event is not included. 

      Is there any way I can determine which machine did initiate the move folder operation?

      Thanks!

      Mike Sperry
      http://www.SperrySoftware.com
      Find 37 Outlook add-ins that can make a difference!

    Wednesday, June 26, 2013 5:23 PM

Answers

  • Hi Mike. I don't think so.

    Can you use OOM events? What if you handle BeforeFolderMove and set a flag or something if it fires. It shouldn't fire if the folder is moved by another user.


    Ken Slovak MVP - Outlook

    Wednesday, June 26, 2013 7:49 PM
    Moderator
  • Nothing else that I can think of would be more practical. Instead of using a Windows hook I'd probably map folders and handle it that way. I think the hook hack would be doable but really ugly.

    Ken Slovak MVP - Outlook

    Friday, June 28, 2013 2:18 PM
    Moderator

All replies

  • Hi Mike. I don't think so.

    Can you use OOM events? What if you handle BeforeFolderMove and set a flag or something if it fires. It shouldn't fire if the folder is moved by another user.


    Ken Slovak MVP - Outlook

    Wednesday, June 26, 2013 7:49 PM
    Moderator
  • Ken,

      Thanks for replying - I cannot figure out how to use the BeforeFolderMove event because I do not map individual folders beforehand, but rather map Redemption stores.  As I'm sure you know, Redemption provides a nice set of events so that I do not need to know beforehand which folder is being moved; but like I said that event occurs in all Outlook instances that have a view to that mailbox (including if the same user is logged into two different workstations - you can try this yourself).

      Right now, I'm thinking about using Windows hooks to determine where the mouse was when it was clicked, and try to deduce if it was within the Outlook folder navigation pane.  That would establish that it wasn't any of the other machines - but that code is going to be really ugly and I'm hoping to avoid it.  I haven't used Spy++ since the Reagan administration.  ;)

      I was really hoping that maybe I was forgetting about some other event or .Net call that would allow me to know the name of the machine (or user) that originated the event.

      Mike Sperry
      http://www.SperrySoftware.com
      Find 37 Outlook add-ins that can make a difference!

    Thursday, June 27, 2013 2:57 PM
  • Nothing else that I can think of would be more practical. Instead of using a Windows hook I'd probably map folders and handle it that way. I think the hook hack would be doable but really ugly.

    Ken Slovak MVP - Outlook

    Friday, June 28, 2013 2:18 PM
    Moderator