Solved

Outlook Object Model - capturing modification or deletion of a Calendar item (AppointmentItem)

Posted on 2014-01-15
11
517 Views
Last Modified: 2014-02-07
Hello expertz!

I'm working on an Outlook Add-in, and I've come up against a brick wall.

We would like the Add-in to perform an action when someone:

1) Is looking at their Calendar and drags and drops and appointment to a different date and time.
2) Is looking at their Calender (again, in the Explorer view), but rather than opening an Appointment Item, deletes it straight from the Explorer. IOW - they single-click on the Appointment and hit the DEL button.


I've been looking through the Outlook Object Model but I can't seem to find any events that cover these things. The add-in was created in Add-in Express so any pointers to any events covered by that platform are welcome too.
0
Comment
Question by:WernerVonBraun
  • 5
  • 5
11 Comments
 
LVL 13

Accepted Solution

by:
Chris Raisin earned 500 total points
ID: 39815126
Can you include a bit of the code you have been playing about with?

I think you need to set up an event handler on a property of an appointment item
(calendar item)  and also capture a "delete" event using "onDelete" method of a calendar item.

I am investigating the best code to produce this, but your existing code will help enormously.

Cheers
Chris (craisin)
0
 
LVL 4

Author Comment

by:WernerVonBraun
ID: 39817194
Oh. Hello Chris.

I had actually forgotten I had posted this question. I have since found a solution.

Apologies

Pino
0
 
LVL 13

Expert Comment

by:Chris Raisin
ID: 39817212
Thanks Pino.

Could you please post the solution for the benefit of others who may have the same problem, and then mark the question as completed.

I look forward to seeing your resolution! :-)

Cheers
Chris
0
Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

 
LVL 4

Author Comment

by:WernerVonBraun
ID: 39817244
I can't post the code, but I will describe the solution.

First of all, I used the adxOutlookEvents_ExplorerBeforeItemPaste event (remember, I'm using Add-in Express).

At that moment, I have access to the item that is being pasted. I save that as a module level variable, and I set a dispatchertimer to tick when the application is inactive. When the timer ticks, the item has already been pasted and its datetime settings have changed, so I can then use that to update the corresponding information in our database.


I have a Class called EventHandler that holds a number of shared objects, including a "current appointment" defined "withevents". in adxOutlookEvents_ExplorerSelectionChanged I set the currentappointment. I can now capture the current appointment's "BeforeDelete" event. When that fires I can run code to update our database accordingly. I am aware that this won't cover the possibility to multi-select appointments and to delete them all in one go. I could, if I had to, code around that eventuality, too but I reckoned it wasn't worth my effort.



We have an Add-in Express form that is displayed at the top of each Calendar appointment when it's displayed. Which is handy as I can access the appointment's Inspector when that form loads. I again use the EventHandler class to keep a reference to that object, and again it's defined WithEvents, so that I can capture the Close event. Upon closing the inspector of an Appointment Item - Inspector_Close() - I can run code that processes any changes made and update our database accordingly.

Job done :-)
0
 
LVL 13

Expert Comment

by:Chris Raisin
ID: 39817328
Great work!  :-)
0
 
LVL 4

Author Comment

by:WernerVonBraun
ID: 39817438
I've requested that this question be closed as follows:

Accepted answer: 0 points for WernerVonBraun's comment #a39817244

for the following reason:

Found my own solution. Wouldn't have minded giving Chris a few points as a thank you for reminding me that this was still open but (s)he didn't actually provide any suggestions this time.
0
 
LVL 13

Expert Comment

by:Chris Raisin
ID: 39817412
I actually did offer a solution (although it was only an idea).

I am male by the way!  :-)   Must start calling myselfChristopher  :-)

Some points would be appreciated since I am trying to get enough to recommence my membership. (Unemployed for over 10 years now because I am 63 and nobody is willing to put an "oldie" to work so I cannot afford the annual fee....have been a member for over 15 years now I think!)

Just love EE! :-)
0
 
LVL 4

Author Closing Comment

by:WernerVonBraun
ID: 39817439
No problem. Since I can't split between myself and A.N.Other the points are all yours.

I thought I'd better play it safe. I know one or two girls who go by "Chris".
0
 
LVL 13

Expert Comment

by:Chris Raisin
ID: 39817481
Thx heaps!
0
 
LVL 4

Author Comment

by:WernerVonBraun
ID: 39841602
Are you sure about that, _alias99 ? I tried to do that, but it either didn't allow me to pick my own ID as one of the contributors, or it didn't allow me to switch points. I don't remember exactly which...
0

Featured Post

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
Large Outlook files lead to various unwanted errors and corruption issues. Furthermore, large outlook files can also make Outlook take longer to start-up, search, navigate, and shut-down. So, In this article, i will discuss a method to make your Out…
CodeTwo Sync for iCloud (http://www.codetwo.com/sync-for-icloud?sts=6554) automatically synchronizes your Outlook 2016, 2013, 2010 or 2007 folders with iCloud folders available via iCloud Control Panel. This lets you automatically sync them with…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question