Find an appointment

G

G. Kumar

Hi, I'm programmatically creating and updating appointments using Visual C#. When I update appointments, is there a better way to find appointments in a calendar without searching for user-changeable fields like the subject field? Right now, I am searching this way:

Outlook.AppointmentItem theMeeting = ((Outlook.AppointmentItem) oItems.Find("[Subject] = 'the subject'"));

where oItems is the items within a calendar folder. Can a field be created programmatically and set to some unique value (like an ID field)? That way, the next time I want to access the appointment, I can run the following command without having to worry about users changing the id:

Outlook.AppointmentItem theMeeting = ((Outlook.AppointmentItem) oItems.Find("[ID] = 'the id'"));

Any help would be appreciated. Thanks!
 
S

Sue Mosher [MVP-Outlook]

Best method is to store the EntryID in your program and then use the
Namespace.GetItemFromID method to return it. The ID may change, however, if
the user moves the item. If your application needs to deal with moved items,
then you'll probably want to implement your own unique ID lookup scheme and
use Find.

FYI, there is a newsgroup specifically for general Outlook programming
issues (even .NET) "down the hall" at microsoft.public.outlook.program_vba
or, via web interface, at
http://www.microsoft.com/office/community/en-us/default.mspx?dg=microsoft.public.outlook.program_vba


--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers



G. Kumar said:
Hi, I'm programmatically creating and updating appointments using Visual
C#. When I update appointments, is there a better way to find appointments
in a calendar without searching for user-changeable fields like the subject
field? Right now, I am searching this way:
Outlook.AppointmentItem theMeeting = ((Outlook.AppointmentItem)
oItems.Find("[Subject] = 'the subject'"));
where oItems is the items within a calendar folder. Can a field be created
programmatically and set to some unique value (like an ID field)? That way,
the next time I want to access the appointment, I can run the following
command without having to worry about users changing the id:
Outlook.AppointmentItem theMeeting = ((Outlook.AppointmentItem)
oItems.Find("[ID] = 'the id'"));
 

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