-1

I (owner of the mailbox) have some shared calendars, I want catch a email of organizer by click on his calendar (I use this info later on my Add-In).

Owner

Globals.ThisAddIn.Application.Session.CurrentUser.AddressEntry.GetExchangeUser().PrimarySmtpAddress

How and where (which file) can I cache this?

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Eden M
  • 171
  • 1
  • 2
  • 15

1 Answers1

0

Explorer.SelectionChange event will fire even if no appointment is selected in the calendar. Or do you mean when a Calendar folder is selected? Use Explorer.FolderSwitch event.

Dmitry Streblechenko
  • 62,942
  • 4
  • 53
  • 78
  • when i clicked on shared calendar. – Eden M Nov 22 '21 at 09:37
  • How I can catch a email of organizer – Eden M Nov 22 '21 at 10:04
  • Do you mean the email of the mailbox owner? Or the organizer of the selected appointment? – Dmitry Streblechenko Nov 22 '21 at 13:18
  • I mean email of the organizer of selected appointment. (email of the mailbox owner is - Globals.ThisAddIn.Application.Session.CurrentUser.AddressEntry.GetExchangeUser().PrimarySmtpAddress) – Eden M Nov 22 '21 at 14:00
  • Namespace.CurrentUser gives you the current user, not the mailbox owner. AppoinmentItem,.Organizer will give you the organizer name. – Dmitry Streblechenko Nov 22 '21 at 15:25
  • AppoinmentItem,.Organizer can you please explain a little more? I got stuck here – Eden M Nov 24 '21 at 13:42
  • 1
    You can loop through the Recipients collection and for each recipient retrieve the `PR_RECIPIENT_FLAGS` MAPI property (DASL name `http://schemas.microsoft.com/mapi/proptag/0x5FFD0003`) using `Recipient.PropertyAccessor.GetProperty` method. Check if the 0x2 bit is set (called `recipOrganizer`) and if yes, use `Recipient.AddressEntry.Address` (for SMTP recipients) or `Recipient.AddressEntry.GetExchangeUser().PrimarySmtpAddress`. – Dmitry Streblechenko Nov 25 '21 at 02:29
  • "http://schemas.microsoft.com/mapi/proptag/0x5FFD0003" is unknown or cannot be found. – Eden M Dec 06 '21 at 22:59
  • No MAPI property is guaranteed to be present, you must expect and handle exceptions like that. Do you see that property in OutlookSpy (select the appointment, click IMessage button on the OutlookSpy ribbon, go to the GetRecipientTable tab)? – Dmitry Streblechenko Dec 06 '21 at 23:23