• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 282
  • Last Modified:

Catch an Item delete

Hi,

I'm customizing the appointment form.
How can I capture the DELETE event of
an existing form (when the user clicks
the delete button and confirms) using vb / vbscript?
0
yronnen
Asked:
yronnen
1 Solution
 
yronnenAuthor Commented:
Edited text of question.
0
 
yronnenAuthor Commented:
Adjusted points to 200
0
 
yronnenAuthor Commented:
Adjusted points to 250
0
Free tool for managing users' photos in Office 365

Easily upload multiple users’ photos to Office 365. Manage them with an intuitive GUI and use handy built-in cropping and resizing options. Link photos with users based on Azure AD attributes. Free tool!

 
PstryCommented:
As of my knowledge: you cannot capture this event in Outlook. Below follows MSDN explanation:
-----------------
ItemRemove Event

Occurs when an item is deleted from the specified collection. This event is not available in VBScript.

Syntax

Sub object_ItemRemove()

object An expression that evaluates to an Items collection object
-----------------

As you can see this event is not available in VBSCRIPT. However you CAN capture it using public folders. There exists Folder_OnMessageDeleted function. Fired (by MS Exchange Event Service) - guess when ? - when message is deleted. Details: http://www.cdolive.com/agent3.htm
0
 
yronnenAuthor Commented:
Pstry,
your answer requires that I install CDO on each of the outlook clients.

The problem is that most of the time these computers are not connected to the network (laptops).

I've tried using the item_remove by:
1. using getobject from my com object to get a reference to the existing outlook application.
2. Since I'm customizing an appointment form I've typed: Set OlItems = objOLApp.GetNamespace("MAPI").GetDefaultFolder(olFolderCalendar).Items
and declared OlItems as items with events - so now I have a pointer to the items collection.

The problem is that the events (especially the remove event) are not working.
0
 
BodyaCommented:
You have writtent that you declared Items object with events. You should use a single item (i.e. AppointmentItem) object with events.

Also I've noticed that when item is deleted Write event occurs. It may help - catch this event, and after a while check if the item still exists in collection. if it doesn't it probably was deleted.
0
 
yronnenAuthor Commented:
Sorry, but that's not a good one. I've tried this method before, and the problem is that I can't use the find method using the EntryID as a search criteria. Meaning - you cannot search an outlook item using it's unique key...

So I MUST catch a delete event when it happens and know what was deleted.
0
 
SMosherCommented:
There is no surefire solution to your issue in the current Outlook/Exchange environment, for the reasons detailed in previous comments.

Exchange 2000 will, for the first time, introduce a synchronous server-based event for catching item deletions before they happen -- when it is still possible to get information out of the item.

Workarounds in the current climate center on monitoring the Deleted Items folder for new items. (This, of course, misses anything deleted with Shift+Delete.)
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now