Find an appointment

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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!
 
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'"));
 
Back
Top