Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Outlook / Contacts / August 2004

Tip: Looking for answers? Try searching our database.

ItemRemove event does not recieve needed parameter

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Mark J. McGinty - 28 Aug 2004 06:22 GMT
I'm processing contact item events by declaring a variable as such:

   Public WithEvents m_ContactItems As Outlook.Items

And initializing it like this:

   Set m_ContactItems =
Outlook.Application.GetNamespace("MAPI").GetDefaultFolder(olFolderContacts).Items

That all works fine, except that as I just went to add an ItemRemove
handler, I saw that, unlike ItemAdd and ItemChange, ItemRemove does not
receive an Item parameter when it's called.  What gives?  How do I determine
which item is being deleted?

tia,
Mark
Ken Slovak - [MVP - Outlook] - 30 Aug 2004 14:34 GMT
There is no real way to get that information. You can try trapping ItemAdd
on the Deleted Items folder's Items collection but that won't trap items
that are hard deleted (Shift+Delete). The only real way is to set up a
collection of items in the folder and compare that collection to the
existing Items collection and seeing what's missing after ItemRemove fires.
It's a hack but that's about all you can do.

Signature

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

> I'm processing contact item events by declaring a variable as such:
>
[quoted text clipped - 3 lines]
>
>     Set m_ContactItems =

Outlook.Application.GetNamespace("MAPI").GetDefaultFolder(olFolderContacts).
Items

> That all works fine, except that as I just went to add an ItemRemove
> handler, I saw that, unlike ItemAdd and ItemChange, ItemRemove does not
[quoted text clipped - 3 lines]
> tia,
> Mark

Rate this thread:






 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.