none
Assigning Appointment Color Codes for Exchange Server 2010 RRS feed

  • Question

  • Hi,

      I have developed a webapplication to work like outlook. See my below code which i was using for exchange server 2007 appointments.

    now, my company has upgraded the to Exchange Server 2010.If i create an appointment using the application, in outlook it shows that

    "No Categories (Colored by old "Travel Required" Label". How to solve this issue. Please any one help;

     

    Code :

     

     Dim service As ExchangeService = GetExchangeService()

                If service Is Nothing Then Return ""

                Dim oAppt As New Appointment(service)

                oAppt.Start = StartDate
                oAppt.End = EndDate
                oAppt.Location = Location
                oAppt.Body = Body
                oAppt.Subject = Subject
                oAppt.Importance = Priority
                oAppt.IsAllDayEvent = IsAllDayEvent
                oAppt.ReminderMinutesBeforeStart = ReminderTime
                oAppt.LegacyFreeBusyStatus = BusyStatus           
                Dim AppointmentColorProperty As ExtendedPropertyDefinition = New ExtendedPropertyDefinition(New Guid("{00062002-0000-0000-C000-000000000046}"), Integer.Parse("8214", Globalization.NumberStyles.HexNumber), MapiPropertyType.Integer)


                If LabelColor <> "" Then
                    oAppt.SetExtendedProperty(AppointmentColorProperty, 1)
                End If

                oAppt.Save(New FolderId(WellKnownFolderName.Calendar))


                EntryId = oAppt.Id.UniqueId

                oAppt = Nothing
                AppointmentColorProperty = Nothing
                service = Nothing

     

     

     

    Monday, July 4, 2011 7:50 AM

Answers

  • The issue is fixed by the below code.

     

                oAppt.Categories.Add("Yellow Category")

    Monday, July 4, 2011 9:09 AM
  • here is the full code.

     

                Dim service As ExchangeService = GetExchangeService()

                If service Is Nothing Then Return ""

                Dim oAppt As New Appointment(service)

                oAppt.Start = StartDate
                oAppt.End = EndDate
                oAppt.Location = Location
                oAppt.Body = Body
                oAppt.Subject = Subject
                oAppt.Importance = Priority
                oAppt.IsAllDayEvent = IsAllDayEvent
                oAppt.ReminderMinutesBeforeStart = ReminderTime
                oAppt.LegacyFreeBusyStatus = BusyStatus
                oAppt.Categories.Add("Yellow Category")

                'Dim AppointmentColorProperty As ExtendedPropertyDefinition = New ExtendedPropertyDefinition(New Guid("{00062002-0000-0000-C000-000000000046}"), Integer.Parse("8214", Globalization.NumberStyles.HexNumber), MapiPropertyType.Integer)


                'If LabelColor <> "" Then
                '    oAppt.SetExtendedProperty(AppointmentColorProperty, 1)
                'End If

                oAppt.Save(New FolderId(WellKnownFolderName.Calendar))


                EntryId = oAppt.Id.UniqueId

                oAppt = Nothing
                'AppointmentColorProperty = Nothing
                service = Nothing

    Monday, July 4, 2011 9:10 AM

All replies

  • The issue is fixed by the below code.

     

                oAppt.Categories.Add("Yellow Category")

    Monday, July 4, 2011 9:09 AM
  • here is the full code.

     

                Dim service As ExchangeService = GetExchangeService()

                If service Is Nothing Then Return ""

                Dim oAppt As New Appointment(service)

                oAppt.Start = StartDate
                oAppt.End = EndDate
                oAppt.Location = Location
                oAppt.Body = Body
                oAppt.Subject = Subject
                oAppt.Importance = Priority
                oAppt.IsAllDayEvent = IsAllDayEvent
                oAppt.ReminderMinutesBeforeStart = ReminderTime
                oAppt.LegacyFreeBusyStatus = BusyStatus
                oAppt.Categories.Add("Yellow Category")

                'Dim AppointmentColorProperty As ExtendedPropertyDefinition = New ExtendedPropertyDefinition(New Guid("{00062002-0000-0000-C000-000000000046}"), Integer.Parse("8214", Globalization.NumberStyles.HexNumber), MapiPropertyType.Integer)


                'If LabelColor <> "" Then
                '    oAppt.SetExtendedProperty(AppointmentColorProperty, 1)
                'End If

                oAppt.Save(New FolderId(WellKnownFolderName.Calendar))


                EntryId = oAppt.Id.UniqueId

                oAppt = Nothing
                'AppointmentColorProperty = Nothing
                service = Nothing

    Monday, July 4, 2011 9:10 AM