Function Restrict

O

othmane benchebab

Hello everybody;

i have one problem with restict function .
When i use this function like :
string filter = string.Format("[Start] >= '{0}' And [End] <= '{1}'", Debut, Fin);
appointmentItems = calendarFolder.Items.Restrict(filter);

that work
but when i use :
string filter = string.Format("[GlobalAppointmentID] = '{0}' ", IdRdv);
appointmentItems = calendarFolder.Items.Restrict(filter);
doesn't work.

can u help me please?
 
K

Ken Slovak - [MVP - Outlook]

You cannot restrict on that property and besides, it's not exposed in the
Outlook object model. You can't restrict on any EntryID or GUID of that type
because in reality they aren't stored as a string value but are stored as
binary properties.
 
O

othmane benchebab

thank you for ure post , but there is no solution to convert the globalId to a string?
 
K

Ken Slovak - [MVP - Outlook]

Sure, you can get it as a binary array and convert it to a string value.

You can't even access it unless you are using Outlook 2007 and use
PropertyAccessor or are using a lower level API such as CDO 1.21 or Extended
MAPI or Redemption (www.dimastr.com/redemption), otherwise it's inaccessible
to you.

No matter what you can't use it for an Outlook object model restriction. You
could use filter in Extended MAPI or Redemption on a MAPITable object or a
table filter in Outlook 2007, but not with the Outlook object model in
versions earlier than Outlook 2007.
 
O

othmane benchebab

thank u again
now i use start and end for the filter to search a selection of appointments
and after i compare the Id of each appointment with my Appointment 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