Outlook appointment change the color of the selected item

Add-in Express™ Support Service
That's what is more important than anything else

Outlook appointment change the color of the selected item
Bernd Michitsch

Posts: 1
Joined: 2006-07-11
Hi NG,
I´ve added some buttons to the appointment form. Some transactions are done... afterwards I ould like to see which items are allready 'sent'. I would like to do this with the standard like 'holiday', 'privat', 'important' so on. How could I change this? In German Outlook the field is called 'Beschriftung'.

Thanks for help,
Posted 11 Jul, 2006 07:52:27 Top
Sergey Grischenko

Add-in Express team

Posts: 7235
Joined: 2004-07-05
Hi Bernd.

There is not a corresponding property in the Outlook Object Model to change the 'Label' field in an appointment item. However you can use Extended MAPI functions to change it. You will have to change the 0x8088 property tag of an appointment item.
Posted 11 Jul, 2006 09:23:03 Top

Posts: 35
Joined: 2006-04-14
Sergey - why can you not provide more assistance than simply to change a property tag? Please understand most of us are not focused in Outlook - so more assistance like the actual function would be more usefull. Here you go Bernd.

Do a good search for Redemption - it is an ok control helping you with Outlook.

        Sub SetApptColorLabel(ByVal objAppt As Outlook.AppointmentItem, ByVal intColor As Integer)
            ' requires reference to CDO 1.21 Library
            ' adapted from sample code by Randy Byrne
            ' intColor corresponds to the ordinal value of the color label
            '1=Important, 2=Business, etc.
                Const CdoPropSetID1 = "0220060000000000C000000000000046"
                Const CdoAppt_Colors = "0x8214"
                Dim objCDO As MAPI.Session
                Dim objMsg As MAPI.Message
                Dim colFields As MAPI.Fields
                Dim objField As MAPI.Field
                Dim strMsg As String
                Dim intAns As Integer
                'On Error Resume Next

                objCDO = CreateObject("MAPI.Session")
                objCDO.Logon("", "", False, False)
                If Not objAppt.EntryID = "" Then
                    objMsg = objCDO.GetMessage(objAppt.EntryID, objAppt.Parent.StoreID)
                    colFields = objMsg.Fields
                    objField = colFields.Item(CdoAppt_Colors, CdoPropSetID1)
                    If objField Is Nothing Then
                        objField = colFields.Add(CdoAppt_Colors, vbLong, intColor, CdoPropSetID1)
                        If objField.Value = 0 Then objField.Value = intColor
                    End If
                    objMsg.Update(True, True)
                End If

                objAppt = Nothing
                objMsg = Nothing
                colFields = Nothing
                objField = Nothing
                objCDO = Nothing
            Catch ex As Exception

            End Try

        End Sub
Posted 16 Jul, 2006 23:41:03 Top