How can I get appointment in item_add event

S

Sky

I want to watch over all appointment delete event and if the appointment is a special one, I will take some special actions.
I have found a way that can catch appointment delete action, not matter how many appointment selected.
The method is:
Dim withevents items as outlook.items
Set Items = Application.GetNamespace("MAPI").GetDefaultFolder(olFolderCalendar).Items
So I can get Items_itemremove event when delete appointment.
But Items_itemremove function has no parameters, so how can I get the current need delete appointment?
 
K

Ken Slovak - [MVP - Outlook]

You can't.

If you are using Outlook 2007 you can use a new event in that object model,
BeforeItemMove, which provides the item being deleted. Otherwise you can
monitor DeletedItems.Items.Add to see what was deleted. That wouldn't help
if the user hard-deleted the item (Shift+Delete) though, which bypasses the
DeletedItems folder. To handle that you'd need to maintain a list of all
items in that folder and see which are missing after a deletion.

BTW, the remove event will fail if 16 or more items are deleted at once,
just like ItemAdd will fail. That's a MAPI limitation. If that many items
are added/deleted/changed all that MAPI provides to Outlook is a folder
changed notification.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top