none
How do I find the delegate that initiated an event? RRS feed

  • Question

  • SCENARIO:

    Manager is UserA.  UserB, UserC, and UserD all have delegate permissions to UserA's calendar.  This is a normal set up in our office.

    When one of these delegates either creates, modifies or deletes an appointmentItem in UserA's calendar we would like to track who initiated the action.  For example.

    UserB creates an appointment in UserA's calendar (AppointmentItem.Organizer will have the value "UserA" ) and the Items_ItemAdd event is fired.  I would like our VSTO Add-In to be able to tell who created that Item.

    I would like to do the same for whomever updated and/or deleted the appointmentItem

    Sunday, April 27, 2014 10:55 AM

Answers

  • If the appointment is directly created/modified in the user A folder by user B, PR_LAST_MODIFIER_ENTRYID / PR_LAST_MODIFIER_NAME / PR_CreatorEmailAddr should point to user B.

    Take a look at the appointment with OutlookSpy (click IMessage) or MFCMAPI to see if these properties really point to user A.


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

    • Marked as answer by TSRACT Monday, May 5, 2014 10:02 PM
    Sunday, April 27, 2014 4:15 PM

All replies

  • Hello,

    You can handle the ItemAdd event of the Calendar folder. In the event handler you can add a marker (for example, a user property or whatever you like) which indicates the "real" organizer. Then in the ItemSend event you can find the associated appointment item and get the value. The MeetingItem class provides the GetAssociatedAppointment method for getting an AppointmentItem object that represents the appointment associated with the meeting request.

    Sunday, April 27, 2014 11:34 AM
  • Interesting. It looks like I would have to trap the folder events on the Manager's calendar to do this.

    For instance, if I'm the manager sitting at my computer with this Add-In running and one of my delegates were to add an appointment to my calendar, I would have no way of knowing who's adding stuff to my calendar.

    I will look into creating the userProperty like you suggested.  It may be the most straightforward way of doing this. 

    There's a PR_CREATOR_NAME property I just stumbled across.  I haven't researched it as yet.  Are you familiar with it?

    Sunday, April 27, 2014 11:49 AM
  • I don't have any shared calendars in the profile at home. But it looks like the PR_CREATOR_NAME property is exactly what you are looking for. It contains the name of the creator of a Message object.

    Sunday, April 27, 2014 2:08 PM
  • If the appointment is directly created/modified in the user A folder by user B, PR_LAST_MODIFIER_ENTRYID / PR_LAST_MODIFIER_NAME / PR_CreatorEmailAddr should point to user B.

    Take a look at the appointment with OutlookSpy (click IMessage) or MFCMAPI to see if these properties really point to user A.


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

    • Marked as answer by TSRACT Monday, May 5, 2014 10:02 PM
    Sunday, April 27, 2014 4:15 PM