View Single Post
  #4  
Old January 20th 09, 03:18 PM posted to microsoft.public.outlook.program_vba
Curiser
external usenet poster
 
Posts: 4
Default How Do I Create a Confirm Deletion Dialog Box for Calendaring?

Thanks for helping me out Ken! Most appreciated. Just a quick follow up
question if i could ask,

What book would you recommened to help a newbie like myself understand the
inner workings on how to modify Outlook 2003 or 2007 using code (VBA)?
Something from both a beginninger perspective, and from a professional
standpoint? Anything on Amazon.com worth taking a look at ?



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

In Outlook 2003 the only BeforeDelete event you can use will only fire if
the item is opened and the user uses the File, Delete menu item. That's the
only available event like that. Otherwise if the user deletes an item from a
folder view or context menu you can trap the ItemRemove event on that
folder's Items collection, but it doesn't have a Cancel argument and doesn't
tell you what was deleted and only fires after the deletion occurs.

You can trap ItemAdd on the Deleted Items folder's Items collection but that
doesn't tell you what folder the item was deleted from and will fire after
the deletion also. And if the user hard deletes an item (Shift+Delete) it
bypasses Deleted Items.

Otherwise you could use ItemRemove of the source folder's Items collection
to alert you something was deleted. Then you handle ItemAdd on
DeletedItems.Items and when something is added there you would check a list
of items in the folder to see what's now missing from there and if the
subject or some other property matches what's missing from the source
folder. That will work in all cases except a hard deletion. It fires after
deletion but would let you recover all soft deleted items.

Outlook 2007 does have an BeforeItemMove event that fires when an item is
deleted and if the target folder is null that tells you the item is being
deleted. It also has a Cancel argument. But that won't help you at all for
Outlook 2003.

If you were to use an alternate API such as Redemption
(www.dimastr.com/redemption) you could use the
RDOFolder.RDOItems.ItemRemove(instanceKey) event. If you cache all the
PR_INSTANCE_KEY properties of all items in a specified folder at start and
then handle that event you will know what item was deleted (it fires after
deletion) and you can then locate the item using that property, assuming the
user hasn't hard deleted it.

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


"Curiser" wrote in message
...
TLDR:
I'd like to create a "Confirm Delete" message box when the event, delete
appointment in Microsoft Outlook 2003 Calendar is triggered. Any ideas?

In-Depth:
We have alot of people who accidently delete their appointments, or any
other agenda items in their Calendars, and we would like to offer a
"confirm"
dialog box that pop-ups within Outlook to verify that they (user) wants to
delete the selected appointment, agenda item, and etc....

Any ideas, can't seem to understand if its for COM or if its an Add-in or
what not. Any pointers?



Ads