PC Review


Reply
Thread Tools Rate Thread

Aborting ItemChange if ItemRemove Event Handler will be called nex

 
 
pkelley
Guest
Posts: n/a
 
      9th Apr 2010
Outlook 2007 Add-In
2005 VSTO Second Edition

In Outlook 2007, with regard to an existing AppointmentItem, when pressing
the "Send Cancellation" Button you get 2 Events: ItemRemove, and ItemChange.
In my experience, the ItemChange Event will fire first, followed by the
ItemRemove Event.

In my Add-In, I have the handle to the current AppointmentItem in both the
ItemChange and ItemRemove Event Handlers.

From within the ItemChange Event Handler, I want to be able to determine
that I can abort immediately since my ItemRemove Event Handler will be called
next.

In my application's case, there is no sense in executing any of the
ItemChange code if the ItemRemove code is about to be called and executed.

I thought I had stumbled onto the answer when I discovered the property:
Microsoft.Office.Interop.Outlook.OlMeetingStatus (olNonMeeting=0,
olMeeting=1, olMeetingReceived=3, olMeetingCanceled=5,
olMeetingReceivedAndCanceled=7), to be contained within the AppointmentItem
Object itself. But sadly, when my ItemChange Event Handler fired, the
current value of the current AppointmentItem was "olMeeting" - I was
expecting to see "olMeetingCanceled".

When my ItemChange Event Handler fires, I do NOT want to continue executing
my ItemChange code if the ItemRemove code is about to be called.

Can anybody think of a way to solve this problem?
 
Reply With Quote
 
 
 
 
Ken Slovak - [MVP - Outlook]
Guest
Posts: n/a
 
      12th Apr 2010
Handle that button click event and set a flag. Check that flag in the
ItemChange() and ItemRemove() events to see what actions to take, then clear
the flag.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"pkelley" <(E-Mail Removed)> wrote in message
news:10B1A6BB-F4D4-4DFF-890F-(E-Mail Removed)...
> Outlook 2007 Add-In
> 2005 VSTO Second Edition
>
> In Outlook 2007, with regard to an existing AppointmentItem, when pressing
> the "Send Cancellation" Button you get 2 Events: ItemRemove, and
> ItemChange.
> In my experience, the ItemChange Event will fire first, followed by the
> ItemRemove Event.
>
> In my Add-In, I have the handle to the current AppointmentItem in both the
> ItemChange and ItemRemove Event Handlers.
>
> From within the ItemChange Event Handler, I want to be able to determine
> that I can abort immediately since my ItemRemove Event Handler will be
> called
> next.
>
> In my application's case, there is no sense in executing any of the
> ItemChange code if the ItemRemove code is about to be called and executed.
>
> I thought I had stumbled onto the answer when I discovered the property:
> Microsoft.Office.Interop.Outlook.OlMeetingStatus (olNonMeeting=0,
> olMeeting=1, olMeetingReceived=3, olMeetingCanceled=5,
> olMeetingReceivedAndCanceled=7), to be contained within the
> AppointmentItem
> Object itself. But sadly, when my ItemChange Event Handler fired, the
> current value of the current AppointmentItem was "olMeeting" - I was
> expecting to see "olMeetingCanceled".
>
> When my ItemChange Event Handler fires, I do NOT want to continue
> executing
> my ItemChange code if the ItemRemove code is about to be called.
>
> Can anybody think of a way to solve this problem?


 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
ItemRemove event stop firing, ItemAdd & ItemChange still work Jason Microsoft Outlook Program Addins 3 4th Mar 2009 11:24 PM
Event handler never called. glenwilkin Microsoft ASP .NET 1 21st Aug 2006 07:39 PM
Re: Application_Startup event handler not being called Michael Kairys Microsoft Outlook VBA Programming 0 1st Aug 2005 12:12 AM
Problems with ItemAdd, ItemChange, ItemRemove events in VC++ kistvan Microsoft Outlook Program Addins 10 19th Aug 2004 02:22 PM
Event Handler Not Called. =?Utf-8?B?U2hyZXlhc2ggQi4gUGF0ZWw=?= Microsoft ASP .NET 2 16th Aug 2004 05:31 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:21 PM.