leora
leora

Reputation: 196539

In outlook vsto 2010, How do i reference the current calendar item if I am on an outlook appointment screen?

I have an outlook 2010 vsto addin and I am able to create new outlook appointments but i now want to edit one (to add recipient or rename the subject, etc). I am struggling to figure out how I can reference an outlook calendar appointment when I bring it up in the Outlook meeting UI.

What is the correct way to get a reference to the current apppointment object when I am in the appointment GUI popup?

Upvotes: 0

Views: 223

Answers (1)

Dmitry Streblechenko
Dmitry Streblechenko

Reputation: 66255

Try Application.ActiveInspector.CurrentItem. Be prepared to handle cases when Application.ActiveInspector is null (no items are open) or when Inspector.CurrentItem is not an appointment.

When is your code invoked? If it is from a ribbon button, the event handler will give you the content - RibbonControl object can be used to read the RibbonControl.Context property, you can then cast it as an Inspector object.

Upvotes: 2

Related Questions