Solved

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

Posted on 2014-01-15
11
520 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
What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

 
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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

Follow this checklist to learn more about the 15 things you should never include in an email signature from personal quotes, animated gifs and out-of-date marketing content.
Read this checklist to learn more about the 15 things you should never include in an email signature.
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …
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…

860 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