?
Solved

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

Posted on 2014-01-15
11
Medium Priority
?
539 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 5
11 Comments
 
LVL 13

Accepted Solution

by:
Chris Raisin earned 2000 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
Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

 
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

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

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

This article lists the top 5 free OST to PST Converter Tools. These tools save a lot of time for users when they want to convert OST to PST after their exchange server is no longer available or some other critical issue with exchange server or impor…
If you troubleshoot Outlook for clients, you may want to know a bit more about the OST file before doing your next job. IMAP can cause a lot of drama if removed in the accounts without backing up.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…
Suggested Courses

801 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