Fetching Move Item Event or when/before a Item is deleted

Add-in Express™ Support Service
That's what is more important than anything else

Fetching Move Item Event or when/before a Item is deleted
 
Matthias Kwiedor


Guest


Hello!

Maybe you can help me with this Problem!

How can i fetch if a Item is moved. I had to get the Information of deleting an Item by the user to update that to a database.


Regards


Matthias
Posted 19 Jan, 2005 10:39:39 Top
Sergey Grischenko


Add-in Express team


Posts: 7187
Joined: 2004-07-05
Hi Matthias,

You should use ItemsEvents object to get information about items within a folder. I will send the example project in a few minutes.
Posted 19 Jan, 2005 11:03:12 Top
Matthias Kwiedor


Guest


Thank you Sergey,

great Support. If you have this example Project in C# is it possible that you send me this :) otherwise i will convert the VB


Regards


Matthias
Posted 20 Jan, 2005 04:47:39 Top
Sergey Grischenko


Add-in Express team


Posts: 7187
Joined: 2004-07-05
Hi Matthias,

You can look at the C# Toys or HowTOs on our web site. There is the code that can be useful for you to convert the example project to C#.
Posted 20 Jan, 2005 09:15:41 Top
Matthias Kwiedor




Posts: 35
Joined: 2004-10-14
Hi Sergey,

after using the Code from your Example i create the Event Handler on the Deleted Folder.


			Outlook.NameSpace oNameSpace = _OutlookApp.GetNamespace("MAPI");
			Outlook.MAPIFolder _delFolder = oNameSpace.Session.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderDeletedItems);

			if (_delFolder != null)
			{
				olItems.ConnectTo(_delFolder.Items);
			}

			CoreModule.ReleaseComObject(_delFolder);
			CoreModule.ReleaseComObject(oNameSpace);


But after some time the Event doesn't get fired up anymore.

I declared the OlItems_Sinkhelper as private.



Regards


Matthias
Posted 08 Feb, 2005 07:45:52 Top
Sergey Grischenko


Add-in Express team


Posts: 7187
Joined: 2004-07-05
Hi Matthias,

Hmm... It is very strange. OK. I will test my code with the Outlook "Deleted Items" folder and let you know about results a little bit later.
Posted 08 Feb, 2005 08:28:03 Top
Matthias Kwiedor




Posts: 35
Joined: 2004-10-14
Hi Sergey,

thank you! I tested it with setting the OlItems_Sinkhelper to public, but after 20 minutes it doesn't fire the event anymore (first after you reconnect the handler). If you want i can send you my Testproject.



Regards


Matthias
Posted 08 Feb, 2005 08:34:55 Top
Sergey Grischenko


Add-in Express team


Posts: 7187
Joined: 2004-07-05
Matthias,

It would be great to get your project. Probably I will find the cause of error more quickly.
Posted 08 Feb, 2005 12:13:11 Top
Sergey Grischenko


Add-in Express team


Posts: 7187
Joined: 2004-07-05
Hi Matthias.

I have a question. Do you use Exchange Server?
Posted 09 Feb, 2005 09:34:32 Top
Matthias Kwiedor




Posts: 35
Joined: 2004-10-14
Hi Sergey,

yes and no. This i had tested with an Exchange Account, but it should work without too. Is this only a problem while using an Exchange Server?


Regards


Matthias
Posted 09 Feb, 2005 09:39:39 Top