A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Add-ins for Outlook
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Problem for getting the source item with ItemRemoveEventHandler



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old May 23rd 06, 03:43 PM posted to microsoft.public.outlook.program_addins
Nico
external usenet poster
 
Posts: 2
Default Problem for getting the source item with ItemRemoveEventHandler

Hello

I have a problem for getting the Appointment Item that has been remove
because there is no parameter allowed in the method call after an
ItemsEvents_ItemRemoveEventHandler. With ItemsEvents_ItemAddEventHandler and
ItemsEvents_ItemChangeEventHandler event I can find the AppointItem that has
been change or modify but how to find it with a ItemRemoveEventHandler event
?


Here is my code :

public void test(){

_application = new Outlook.Application();
_nameSpace = _application.GetNamespace("MAPI");
_mfCalendar =
_nameSpace.GetDefaultFolder(OlDefaultFolders.olFol derCalendar);
ItemsEvents_ItemRemoveEventHandler iaehRemove =
new
ItemsEvents_ItemRemoveEventHandler(this.Appointmen tItemRemove);
_itemsCalendar2.ItemRemove += iaehRemove;
}


public void AppointmentItemRemove()
{
// how to find here which Appointment item has been deleted ?
}

PS : I use Visual Studio 2005 with C#.

Thanks in advance


  #2  
Old May 24th 06, 05:19 AM posted to microsoft.public.outlook.program_addins
Dave Kane [MVP - Outlook]
external usenet poster
 
Posts: 33
Default Problem for getting the source item with ItemRemoveEventHandler

You'll need to add an ItemAdd handler to the Deleted Items folder to find
out which appointment was actually removed. Keep in mind that the
appointment's EntryID will have changed since it's in a new folder, so you
will need to use some other property to identify the item.

As you may know, Outlook 2003 SP2 made changes in the way calendar items are
handled (http://support.microsoft.com/?kbid=899919) From the article "The
new design works as follows. When a user accepts or tentatively accepts a
meeting, either from a meeting request or from a calendar item, the existing
calendar item is deleted from the calendar. Additionally, a duplicate of the
calendar item is created for the deleted item. Therefore, the new calendar
item has an Entry ID that is different from the Entry ID of the old calendar
item."

This means that your handlers may trap a delete and an add that are both for
the same appointment. The article describes how the Global Object ID
property is a more reliable way to track appointments. Unfortunately it's
not exposed by the Outlook object model, so you will need to use an Extended
MAPI library to get it.

"Nico" wrote in message
...
Hello

I have a problem for getting the Appointment Item that has been remove
because there is no parameter allowed in the method call after an
ItemsEvents_ItemRemoveEventHandler. With ItemsEvents_ItemAddEventHandler
and ItemsEvents_ItemChangeEventHandler event I can find the AppointItem
that has been change or modify but how to find it with a
ItemRemoveEventHandler event ?


Here is my code :

public void test(){

_application = new Outlook.Application();
_nameSpace = _application.GetNamespace("MAPI");
_mfCalendar =
_nameSpace.GetDefaultFolder(OlDefaultFolders.olFol derCalendar);
ItemsEvents_ItemRemoveEventHandler iaehRemove =
new
ItemsEvents_ItemRemoveEventHandler(this.Appointmen tItemRemove);
_itemsCalendar2.ItemRemove += iaehRemove;
}


public void AppointmentItemRemove()
{
// how to find here which Appointment item has been deleted ?
}

PS : I use Visual Studio 2005 with C#.

Thanks in advance




  #3  
Old May 24th 06, 09:12 AM posted to microsoft.public.outlook.program_addins
Nico
external usenet poster
 
Posts: 2
Default Problem for getting the source item with ItemRemoveEventHandler


Thanks for this clear answer !

"Dave Kane [MVP - Outlook]" a écrit dans le message de
news: ...
You'll need to add an ItemAdd handler to the Deleted Items folder to find
out which appointment was actually removed. Keep in mind that the
appointment's EntryID will have changed since it's in a new folder, so you
will need to use some other property to identify the item.

As you may know, Outlook 2003 SP2 made changes in the way calendar items
are handled (http://support.microsoft.com/?kbid=899919) From the article
"The new design works as follows. When a user accepts or tentatively
accepts a meeting, either from a meeting request or from a calendar item,
the existing calendar item is deleted from the calendar. Additionally, a
duplicate of the calendar item is created for the deleted item. Therefore,
the new calendar item has an Entry ID that is different from the Entry ID
of the old calendar item."

This means that your handlers may trap a delete and an add that are both
for the same appointment. The article describes how the Global Object ID
property is a more reliable way to track appointments. Unfortunately it's
not exposed by the Outlook object model, so you will need to use an
Extended MAPI library to get it.

"Nico" wrote in message
...
Hello

I have a problem for getting the Appointment Item that has been remove
because there is no parameter allowed in the method call after an
ItemsEvents_ItemRemoveEventHandler. With ItemsEvents_ItemAddEventHandler
and ItemsEvents_ItemChangeEventHandler event I can find the AppointItem
that has been change or modify but how to find it with a
ItemRemoveEventHandler event ?


Here is my code :

public void test(){

_application = new Outlook.Application();
_nameSpace = _application.GetNamespace("MAPI");
_mfCalendar =
_nameSpace.GetDefaultFolder(OlDefaultFolders.olFol derCalendar);
ItemsEvents_ItemRemoveEventHandler iaehRemove =
new
ItemsEvents_ItemRemoveEventHandler(this.Appointmen tItemRemove);
_itemsCalendar2.ItemRemove += iaehRemove;
}


public void AppointmentItemRemove()
{
// how to find here which Appointment item has been deleted ?
}

PS : I use Visual Studio 2005 with C#.

Thanks in advance






 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem getting Incoming Item in my Outlook Addin seby Add-ins for Outlook 1 May 6th 06 07:44 PM
Problem with seeing html on the source tab page JennyB Outlook Express 1 April 27th 06 11:35 AM
Problem with setting Outlook item userproperties KeithXP Outlook and VBA 4 April 14th 06 03:01 PM
Problem with calendar item & Outlook 2003 Andreas Koepke Outlook - General Queries 1 March 17th 06 10:40 AM
Shortcut for Message Source? Larry Serflaten Outlook Express 13 January 25th 06 02:11 PM


All times are GMT +1. The time now is 05:30 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.