{"id":577,"date":"2005-04-16T01:21:53","date_gmt":"2005-04-15T23:21:53","guid":{"rendered":"http:\/\/10.0.0.2\/wordpress\/?p=577"},"modified":"2005-04-16T01:21:53","modified_gmt":"2005-04-15T23:21:53","slug":"change_outlook_appointment_label_color","status":"publish","type":"post","link":"https:\/\/www.switchbl8.nl\/blog\/2005\/04\/change_outlook_appointment_label_color\/","title":{"rendered":"Change Outlook appointment label (color)"},"content":{"rendered":"<p>Okay, I did it. Why this is so completely and utterly undocumented, I don&#8217;t know. There are no proper examples in C# (lot&#8217;s of VB.NET, but some methods take different arguments, some methods\/properties don&#8217;t exist) to change the Appointment&#8217;s color (&#8220;label&#8221; in the Outlook-dialog) programmaticaly. So here goes, for your sake.<\/p>\n<p><code><br \/>\n{<br \/>\n\tMAPI.Session myMAPISession = new MAPI.SessionClass();<br \/>\n\tobject myMV = System.Reflection.Missing.Value;<br \/>\n\tmyMAPISession.Logon(\"Microsoft Outlook Internet Settings\",myMV,false,myMV,myMV,myMV,myMV);<br \/>\n\tMAPI.Message myMAPIMessage = (MAPI.Message)myMAPISession.GetMessage(Afspraak.EntryID,myMV);<br \/>\n\tMAPI.Fields myMAPIFields = (MAPI.Fields)myMAPIMessage.Fields;<br \/>\n\tMAPI.Field myApptLabel = (MAPI.Field)myMAPIFields.get_Item(\"0x8214\",\"0220060000000000C000000000000046\");<br \/>\n\tif(myApptLabel.Equals(null))<br \/>\n\t{<br \/>\n\t\tmyApptLabel = (MAPI.Field)myMAPIFields.Add(\"0x8214\",\"long\",3,\"0220060000000000C000000000000046\");<br \/>\n\t}<br \/>\n\telse<br \/>\n\t{<br \/>\n\t\tmyApptLabel.Value = 3;<br \/>\n\t}<br \/>\n\tmyMAPIMessage.Update(true,true);<br \/>\n}<br \/>\n<\/code><br \/>\nNow help me out: how can I change the hardcoded &#8220;Microsoft Outlook Internet Settings&#8221; to some constant or variable pointing at the default profile?<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Okay, I did it. Why this is so completely and utterly undocumented, I don&#8217;t know. There are no proper examples in C# (lot&#8217;s of VB.NET, but some methods take different arguments, some methods\/properties don&#8217;t exist) to change the Appointment&#8217;s color (&#8220;label&#8221; in the Outlook-dialog) programmaticaly. So here goes, for your sake. { MAPI.Session myMAPISession = <a href='https:\/\/www.switchbl8.nl\/blog\/2005\/04\/change_outlook_appointment_label_color\/' class='excerpt-more'>[&#8230;]<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[39,40,8],"tags":[],"class_list":["post-577","post","type-post","status-publish","format-standard","hentry","category-c","category-code-snippets","category-development","category-39-id","category-40-id","category-8-id","post-seq-1","post-parity-odd","meta-position-corners","fix"],"_links":{"self":[{"href":"https:\/\/www.switchbl8.nl\/blog\/wp-json\/wp\/v2\/posts\/577","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.switchbl8.nl\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.switchbl8.nl\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.switchbl8.nl\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.switchbl8.nl\/blog\/wp-json\/wp\/v2\/comments?post=577"}],"version-history":[{"count":0,"href":"https:\/\/www.switchbl8.nl\/blog\/wp-json\/wp\/v2\/posts\/577\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.switchbl8.nl\/blog\/wp-json\/wp\/v2\/media?parent=577"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.switchbl8.nl\/blog\/wp-json\/wp\/v2\/categories?post=577"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.switchbl8.nl\/blog\/wp-json\/wp\/v2\/tags?post=577"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}