Outlook Banter

Outlook Banter (http://www.outlookbanter.com/)
-   Add-ins for Outlook (http://www.outlookbanter.com/add-ins-outlook/)
-   -   How to detect a user-deleted AppointmentItem? (http://www.outlookbanter.com/add-ins-outlook/35825-how-detect-user-deleted-appointmentitem.html)

OctopusThu December 20th 06 09:40 AM

How to detect a user-deleted AppointmentItem?
 
I deleted an AppoitmentItem using the Outlook GUI. But still I can get the
AppointmentItem with the NameSpace.GetItemFromID() method. I guessed the
method should have returned a null value but I was wrong.

Then, how can I detect whether an AppointmentItem with the speciied EntryID
has been deleted by using the GUI?

Sue Mosher [MVP-Outlook] December 20th 06 12:34 PM

How to detect a user-deleted AppointmentItem?
 
Deleting the item just moved it to the Deleted Items folder. It has the same EntryID there that it did in its original location. Check the Parent property of the item that GetItemFromID returns.

--
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

"OctopusThu" wrote in message ...
I deleted an AppoitmentItem using the Outlook GUI. But still I can get the
AppointmentItem with the NameSpace.GetItemFromID() method. I guessed the
method should have returned a null value but I was wrong.

Then, how can I detect whether an AppointmentItem with the speciied EntryID
has been deleted by using the GUI?


OctopusThu December 20th 06 04:08 PM

How to detect a user-deleted AppointmentItem?
 
Thank you, Sue.
I can now cast the item.Parent property to an Outlook.MAPIFolder object, and
compare its EntryID with the former folder's EntryID, so as to determine
whether the item has been deleted.

Do you have some more safer/smarter method to do this?

"Sue Mosher [MVP-Outlook]" wrote:

Deleting the item just moved it to the Deleted Items folder. It has the same EntryID there that it did in its original location. Check the Parent property of the item that GetItemFromID returns.

--
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

"OctopusThu" wrote in message ...
I deleted an AppoitmentItem using the Outlook GUI. But still I can get the
AppointmentItem with the NameSpace.GetItemFromID() method. I guessed the
method should have returned a null value but I was wrong.

Then, how can I detect whether an AppointmentItem with the speciied EntryID
has been deleted by using the GUI?



Sue Mosher [MVP-Outlook] December 20th 06 04:39 PM

How to detect a user-deleted AppointmentItem?
 
That sounds like a good approach.

--
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

"OctopusThu" wrote in message ...
Thank you, Sue.
I can now cast the item.Parent property to an Outlook.MAPIFolder object, and
compare its EntryID with the former folder's EntryID, so as to determine
whether the item has been deleted.

Do you have some more safer/smarter method to do this?

"Sue Mosher [MVP-Outlook]" wrote:

Deleting the item just moved it to the Deleted Items folder. It has the same EntryID there that it did in its original location. Check the Parent property of the item that GetItemFromID returns.



"OctopusThu" wrote in message ...
I deleted an AppoitmentItem using the Outlook GUI. But still I can get the
AppointmentItem with the NameSpace.GetItemFromID() method. I guessed the
method should have returned a null value but I was wrong.

Then, how can I detect whether an AppointmentItem with the speciied EntryID
has been deleted by using the GUI?



Ken Slovak - [MVP - Outlook] December 20th 06 06:20 PM

How to detect a user-deleted AppointmentItem?
 
Although comparing EntryID properties without using a special procedure
(like CompareEntryIDs in CDO or Redemption) can fail, especially for items
where you can get short or long term id's. And when an item is deleted from
an Exchange mailbox the EntryID on the item changes. It does not change when
deleted in a PST file.

I'd probably use ItemAdd on the Items collection of the Deleted Items
folder.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"Sue Mosher [MVP-Outlook]" wrote in message
...
That sounds like a good approach.

--
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

"OctopusThu" wrote in message
...
Thank you, Sue.
I can now cast the item.Parent property to an Outlook.MAPIFolder object,
and
compare its EntryID with the former folder's EntryID, so as to determine
whether the item has been deleted.

Do you have some more safer/smarter method to do this?



OctopusThu December 21st 06 04:47 AM

How to detect a user-deleted AppointmentItem?
 
What is the "ItemAdd" that you mentioned?
And how to get the deleted Items folder?
Are all the deleted Items in the same folder? For example, the deleted
AppointItems and MailItems.

"Ken Slovak - [MVP - Outlook]" wrote:

Although comparing EntryID properties without using a special procedure
(like CompareEntryIDs in CDO or Redemption) can fail, especially for items
where you can get short or long term id's. And when an item is deleted from
an Exchange mailbox the EntryID on the item changes. It does not change when
deleted in a PST file.

I'd probably use ItemAdd on the Items collection of the Deleted Items
folder.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"Sue Mosher [MVP-Outlook]" wrote in message
...
That sounds like a good approach.

--
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

"OctopusThu" wrote in message
...
Thank you, Sue.
I can now cast the item.Parent property to an Outlook.MAPIFolder object,
and
compare its EntryID with the former folder's EntryID, so as to determine
whether the item has been deleted.

Do you have some more safer/smarter method to do this?




Ken Slovak - [MVP - Outlook] December 21st 06 02:20 PM

How to detect a user-deleted AppointmentItem?
 
ItemAdd is an event of the Items collection. Each folder has an Items
collection. To get the Deleted Items folder you would use
NameSpace.GetDefaultFolder(olFolderDeletedItems), which returns a MAPIFolder
object. All of that is in the Object Browser, which you should learn to use.
It exposes all properties, methods and events for all objects in the object
model.

Any item that's deleted goes into Deleted Items unless it's "hard deleted"
(Shift+Delete). In those cases the items are just deleted. To detect that
you can handle the ItemRemove method of an Items collection for a folder,
which just tells you that something was deleted but not what. Then you'd
have to iterate the Items collection of that folder to see what's missing.

Try deleting some different types of items to see where they go, empirical
experimentation is really the way to go to find out how something works.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"OctopusThu" wrote in message
...
What is the "ItemAdd" that you mentioned?
And how to get the deleted Items folder?
Are all the deleted Items in the same folder? For example, the deleted
AppointItems and MailItems.




All times are GMT +1. The time now is 03:39 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-2006 OutlookBanter.com