Outlook 2007 + GetItemFromID with specified folder

M

Marcin Junger

Hi Everybody,
I am working on adapting existing outlook plugin (designed for
Outlook 2003) to Outlook 2007.
Basically, the plugin synchronizes appointments, tasks and contacts
with another application. The plugin stores a mapping table with two
columns: Outlook_ID and Application_ID (there is a separate table for
appointments, tasks and contacts).
So far to detect items deleted in Outlook I was going through the
mapping table and calling GetItemFromID for each mapped outlook item -
if the GetItemFromID raised an exception that meant that the appointment
was deleted. Now, in Outlook 2007 GetItemFromID returns valid item even
if that item was deleted.
The example call for appointments is:
vAppointment := NameSpace.GetItemFromID(sEID,sAppointmentStoreID);
where sEID is appointment entry id and sAppointmentStoreID is Calendar
folder's StoreID. What is interesting, Folder.Items.Count decreases when
I delete the item.

I have found a workaround for appointments and tasks - i check if the
Parent points to item's folder - it does not if the item was deleted.
Unfortunately, the Parent of a contact does point to the Contacts folder
even if the contact was deleted (and still ContactFolder.Items.Count
decreases when I delete a contact).

How can I check if returned item (appointment, task or contact) actually
was deleted?

Kind Regards
Marcin Junger
http:\\mjunger.hornet.eu.org
 
M

Michael Bauer [MVP - Outlook]

Marcin, GetItemFromID works as long as the IDs don't change - even if the
item is moved into the DeletedItems folder.

I'd go this way: Get all item's IDs of a folder and check them against your
mapping table.

--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
The most effective way to assign Outlook categories:
http://www.shareit.com/product.html?productid=300120654&languageid=1
(German: http://www.VBOffice.net/product.html?pub=6)

Am Tue, 13 Mar 2007 16:00:29 +0000 schrieb Marcin Junger:
 

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