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

Deleted Items



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old March 6th 06, 05:36 PM posted to microsoft.public.outlook.program_addins
Rog
external usenet poster
 
Posts: 62
Default Deleted Items

Hey guys, I want to check if an item exists in the DeletedItems Folder,
but if I use item.Parent, it will show me the original folder of the
item. So if I delete a task through outlook UI, and then in my code
check the Parent it will still show as Tasks until I shutdown outlook
and restart. It is like it does not pick up the fact that this item is
in the Deleted Items folder until I restart outlook. I do not want to
enumerate through all of the deleted items each time, so do you have any
suggestions?
Thanks
  #2  
Old March 6th 06, 06:12 PM posted to microsoft.public.outlook.program_addins
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default Deleted Items

Please show the code you're using the access the item and explain what event you're using to run it.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx


"Rog" wrote in message ...
Hey guys, I want to check if an item exists in the DeletedItems Folder,
but if I use item.Parent, it will show me the original folder of the
item. So if I delete a task through outlook UI, and then in my code
check the Parent it will still show as Tasks until I shutdown outlook
and restart. It is like it does not pick up the fact that this item is
in the Deleted Items folder until I restart outlook. I do not want to
enumerate through all of the deleted items each time, so do you have any
suggestions?
Thanks

  #3  
Old March 7th 06, 01:48 AM posted to microsoft.public.outlook.program_addins
Rog
external usenet poster
 
Posts: 62
Default Deleted Items

Thanks as always Sue:

Outlook.MAPIFolder mFolder
=(Outlook.MAPIFolder)HelperClass.GetPropertyHelper (item, "Parent");
string fname = mFolder.Name;

if(fname.IndexOf("Deleted") = 0)
{

}

"fname" seems to be the original folder that the item was deleted from,
not the deleted items folder. If I close outlook and restart then it
picks up.
I am running this code on a button click not on any outlook event.
Rog

Sue Mosher [MVP-Outlook] wrote:
Please show the code you're using the access the item and explain what event you're using to run it.

  #4  
Old March 7th 06, 02:36 AM posted to microsoft.public.outlook.program_addins
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default Deleted Items

How does GetPropertyHelper work? And how -- and when -- is Item instantiated?

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx


"Rog" wrote in message ...
Thanks as always Sue:

Outlook.MAPIFolder mFolder
=(Outlook.MAPIFolder)HelperClass.GetPropertyHelper (item, "Parent");
string fname = mFolder.Name;

if(fname.IndexOf("Deleted") = 0)
{

}

"fname" seems to be the original folder that the item was deleted from,
not the deleted items folder. If I close outlook and restart then it
picks up.
I am running this code on a button click not on any outlook event.


Hey guys, I want to check if an item exists in the DeletedItems Folder,
but if I use item.Parent, it will show me the original folder of the
item. So if I delete a task through outlook UI, and then in my code
check the Parent it will still show as Tasks until I shutdown outlook
and restart. It is like it does not pick up the fact that this item is
in the Deleted Items folder until I restart outlook. I do not want to
enumerate through all of the deleted items each time, so do you have any
suggestions?
Thanks

  #5  
Old March 7th 06, 02:39 PM posted to microsoft.public.outlook.program_addins
Rog
external usenet poster
 
Posts: 62
Default Deleted Items

public static object GetPropertyHelper(object targetObject, string
propertyName)
{
try
{
return targetObject.GetType().InvokeMember(propertyName,
System.Reflection.BindingFlags.Public |
System.Reflection.BindingFlags.Instance |
System.Reflection.BindingFlags.GetProperty,
null,
targetObject,
null,
System.Globalization.CultureInfo.CurrentCulture);
}
catch(System.Exception ex)
{
GlobalConstants.Log(log, "Error", "GetPropertyHelper", ex);
return null;
}
}

and
object item =
this.OutlookApp.GetNamespace("MAPI").GetItemFromID (entryID, storeID);

Thanks so much.

Sue Mosher [MVP-Outlook] wrote:
How does GetPropertyHelper work? And how -- and when -- is Item instantiated?

  #6  
Old March 7th 06, 03:31 PM posted to microsoft.public.outlook.program_addins
Rog
external usenet poster
 
Posts: 62
Default Deleted Items

I even tried using redemption and getting property 0x0E090102 but it
returns the entryid of the contacts folder (where it was deleted from)
not the entryid of the deleted items folder. but if I use OutlookSpy and
look at 0x0E090102 property then it shows the entryid of the Deleted
Items folder for that Contact.

Rog wrote:
public static object GetPropertyHelper(object targetObject,
string propertyName)
{
try
{
return targetObject.GetType().InvokeMember(propertyName,
System.Reflection.BindingFlags.Public |
System.Reflection.BindingFlags.Instance |
System.Reflection.BindingFlags.GetProperty,
null,
targetObject,
null,
System.Globalization.CultureInfo.CurrentCulture);
}
catch(System.Exception ex)
{
GlobalConstants.Log(log, "Error", "GetPropertyHelper", ex);
return null;
}
}

and
object item =
this.OutlookApp.GetNamespace("MAPI").GetItemFromID (entryID, storeID);

Thanks so much.

Sue Mosher [MVP-Outlook] wrote:
How does GetPropertyHelper work? And how -- and when -- is Item
instantiated?

 




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
Deleted email not going to Deleted Items folder techie_comps Outlook - General Queries 1 February 27th 06 05:59 PM
2 different Deleted Items folders?? Al Clark Outlook - General Queries 1 February 21st 06 10:49 AM
Inbox, Sent Items & Outbox in Deleted Items in Outlook 2003 & OWA with Exchange splounx Outlook - General Queries 1 February 17th 06 03:22 AM
Recover Deleted Items Paul Johnson Outlook - General Queries 1 February 9th 06 04:10 PM
how to clear deleted items? [email protected] Outlook - General Queries 3 January 16th 06 03:36 PM


All times are GMT +1. The time now is 03:22 PM.


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.