none
Change category of an appointment

    Question

  •  

    Hi!

     

    How can I change the category of calendarItemType (appointment) to for example "blue category" (one of the categories in the ordinary calendar form using Exchange Web Services?

     

    Best regards,

     

    Per Ljung

    Wednesday, November 26, 2008 4:11 PM

All replies

  • You just use the Categories properties this is a array of strings so if there are other categories set and you want to retain them you need to get the existing values loop through the array find the one you want to update and changes this and then just update the Categories property like any other EWS update.

     

    Cheers

    Glen

     

     

    Thursday, November 27, 2008 12:08 AM
  • Hi!

     

    But which index of the categories array is the category that's assigned to the appointment? There is no property "Category" on an appointment, just "Categories". If I set the categories property to some strings, which one of the strings becomes the category of the appointment?

     

    Is categories an UnIndexedFieldUriType?

     

    Best regards,

     

    Per Ljung

     

    Thursday, November 27, 2008 12:17 PM
  • An appointment like any item in Exchange can have one or more categories so im not sure what you talking about in regards to a category property. The Categories that have been assigned to an object are stored in the Categories property. If only one category has been assigned then you will just have an array with one element. The array isn't indexed and the elements aren't stored in any order it basically FIFO based on the order the user set them so if you want to update a particular category you will need to loop though all the elements in the array and find the one you want to set. If a category hasn't been set on a item then it wont exist in the property.

     

    The cateories properties is inherited from the base class ItemType so when your updating it you would use UnindexedFieldURIType.itemCategories. You need to either update the property as a whole eg grab the categories array make your modifications then post the whole array back in a Updateitem operation. Or possibly you could do an append if you adding a new item (never tried that through with this property).

     

    Cheers

    Glen

     

     

     

    Thursday, November 27, 2008 9:47 PM
  • Hi!

     

    The reason I want to set categories on an appointment is to change the label color of an appointment. Is it possible to do this with categories?

     

    Today, in Outlook at my company, we are using categories to flag that an appointment (a particular job for a customer) has been finished, not started, or started. That makes it easy to see which jobs that have been finished and the booking rate for a particular consultant.

     

    Best regards,

     

    Per Ljung

     

    Friday, November 28, 2008 2:14 PM
  • Yes you can Oultook and OWA matchs the Text in the categories property against the master cateogry list to determine the colour (or colours) an item gets (this is Outlook 2007/Exchange 2007 only previous version of Outlook did this different). I would suggest that you try changing the property yourself and observe what happens you don't have to even write any code just use a Mapi editor like OutlookSpy or MFCMapi.

     

    Cheers

    Glen

     

     

    Saturday, November 29, 2008 9:35 PM