{"id":1113,"date":"2008-05-13T04:32:09","date_gmt":"2008-05-13T04:32:09","guid":{"rendered":"https:\/\/kweaver.org\/cs\/documentation-c\/"},"modified":"2008-05-13T04:32:09","modified_gmt":"2008-05-13T04:32:09","slug":"documentation-c","status":"publish","type":"post","link":"https:\/\/kweaver.org\/cs\/documentation-c\/","title":{"rendered":"Documentation can be SO irritating!"},"content":{"rendered":"<p style=\"margin-top: 0; margin-bottom: 0\">I decided I wanted to do the regular Windows to Outlook side of the project first.&#160; It makes sense having both, as I often change my sets in the morning, in front of my desktop computers. <\/p>\n<p style=\"margin-top: 0; margin-bottom: 0;\">&#160;<\/p>\n<p style=\"margin-top: 0; margin-bottom: 0;\">So I wanted to figure out how to create an Outlook item.&#160; I started with this article:<\/p>\n<p style=\"margin-top: 0; margin-bottom: 0;\">&#160;<\/p>\n<p style=\"margin-top: 0; margin-bottom: 0;\"><a href=\"http:\/\/support.microsoft.com\/kb\/313787\">http:\/\/support.microsoft.com\/kb\/313787<\/a><\/p>\n<p style=\"margin-top: 0; margin-bottom: 0;\">&#160;<\/p>\n<p style=\"margin-top: 0; margin-bottom: 0;\">Lovely article but I couldn&#8217;t get it to compile.&#160; I started doing research on the error message and kept running into references to PIA&#8217;s.&#160; I found them, and I had to install them.<\/p>\n<p style=\"margin-top: 0; margin-bottom: 0;\">&#160;<\/p>\n<p style=\"margin-top: 0; margin-bottom: 0;\"><a href=\"http:\/\/www.microsoft.com\/downloads\/thankyou.aspx?familyId=59daebaa-bed4-4282-a28c-b864d8bfa513&amp;displayLang=en\">http:\/\/www.microsoft.com\/downloads\/thankyou.aspx?familyId=59daebaa-bed4-4282-a28c-b864d8bfa513&amp;displayLang=en<\/a><\/p>\n<p style=\"margin-top: 0; margin-bottom: 0;\">&#160;<\/p>\n<p style=\"margin-top: 0; margin-bottom: 0;\">I also found this article which was helpful too:<\/p>\n<p style=\"margin-top: 0; margin-bottom: 0;\">&#160;<\/p>\n<p style=\"margin-top: 0; margin-bottom: 0;\"><a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/bb226711.aspx#officeoutlook2007whatsnewdeveloperspart1__intro\">http:\/\/msdn.microsoft.com\/en-us\/library\/bb226711.aspx#officeoutlook2007whatsnewdeveloperspart1__intro <\/a><\/p>\n<p style=\"margin-top: 0; margin-bottom: 0;\">&#160;<\/p>\n<p style=\"margin-top: 0; margin-bottom: 0;\">So here is what I had to do to create an Outlook Calendar entry (which does work).<\/p>\n<p style=\"margin-top: 0; margin-bottom: 0;\">&#160;<\/p>\n<p style=\"margin-top: 0; margin-bottom: 0;\">I had to add an reference to the PIAs:<\/p>\n<p style=\"margin-top: 0; margin-bottom: 0;\">&#160;<\/p>\n<p style=\"margin-top: 0; margin-bottom: 0;\"> Add a reference to the PIAs. To do this, follow   these steps: <\/p>\n<table>\n<tr>\n<td>a. <\/td>\n<td>On the Project menu, click Add Reference.<\/td>\n<\/tr>\n<tr>\n<td>b. <\/td>\n<td>Click the NET tab, locate Microsoft.Outlook.Interop.Outlook, and then click   Select. <\/td>\n<\/tr>\n<tr>\n<td>c. <\/td>\n<td>In the Add References dialog box,   click OK<\/td>\n<\/tr>\n<\/table>\n<p style=\"margin-top: 0; margin-bottom: 0\">&#160;<\/p>\n<p style=\"margin-top: 0; margin-bottom: 0;\">The next thing I had to do was to add the following statement to the top of the program:<\/p>\n<p style=\"margin-top: 0; margin-bottom: 0;\">&#160;<\/p>\n<p style=\"margin-top: 0; margin-bottom: 0;\">It now looks like:<\/p>\n<p style=\"margin-top: 0; margin-bottom: 0;\">&#160;<\/p>\n<p style=\"margin-top: 0; margin-bottom: 0;\">Imports System.Reflection<br \/>\nImports outlook = Microsoft.Office.Interop.Outlook<\/p>\n<p style=\"margin-top: 0; margin-bottom: 0;\">&#160;<\/p>\n<p style=\"margin-top: 0; margin-bottom: 0;\">Module Module1<\/p>\n<p style=\"margin-top: 0; margin-bottom: 0;\">&#160;<\/p>\n<p style=\"margin-top: 0; margin-bottom: 0;\"> Sub Main()<br \/>\n&#8216; Create an Outlook application.<br \/>\nDim oApp As Outlook.Application = New Outlook.Application()<\/p>\n<p style=\"margin-top: 0; margin-bottom: 0;\">&#160;<\/p>\n<p style=\"margin-top: 0; margin-bottom: 0;\"> &#8216; Get NameSpace and Logon.<br \/>\nDim oNS As Outlook.NameSpace = oApp.GetNamespace(&quot;mapi&quot;)<br \/>\noNS.Logon(&quot;YourValidProfile&quot;, Missing.Value, False, True) &#8216; TODO:<\/p>\n<p style=\"margin-top: 0; margin-bottom: 0;\">&#160;<\/p>\n<p style=\"margin-top: 0; margin-bottom: 0;\"> &#8216; Create a new AppointmentItem.<br \/>\nDim oAppt As Outlook.AppointmentItem = oApp.CreateItem(Outlook.OlItemType.olAppointmentItem)<br \/>\n&#8216;oAppt.Display(true)  &#8216;Modal <\/p>\n<p style=\"margin-top: 0; margin-bottom: 0;\">&#160;<\/p>\n<p style=\"margin-top: 0; margin-bottom: 0;\"> &#8216; Set some common properties.<br \/>\noAppt.Subject = &quot;Created using OOM in C#&quot;<br \/>\noAppt.Body = &quot;Hello World&quot;<br \/>\noAppt.Location = &quot;Samm E&quot;<\/p>\n<p style=\"margin-top: 0; margin-bottom: 0;\">&#160;<\/p>\n<p style=\"margin-top: 0; margin-bottom: 0;\"> oAppt.Start = Convert.ToDateTime(&quot;11\/30\/2001 9:00:00 AM&quot;)<br \/>\noAppt.End = Convert.ToDateTime(&quot;11\/30\/2001 1:00:00 PM&quot;)<\/p>\n<p style=\"margin-top: 0; margin-bottom: 0;\">&#160;<\/p>\n<p style=\"margin-top: 0; margin-bottom: 0;\"> oAppt.ReminderSet = True<br \/>\noAppt.ReminderMinutesBeforeStart = 5<br \/>\noAppt.BusyStatus = Outlook.OlBusyStatus.olBusy  &#8216;  olBusy<br \/>\noAppt.IsOnlineMeeting = False<\/p>\n<p style=\"margin-top: 0; margin-bottom: 0;\">&#160;<\/p>\n<p style=\"margin-top: 0; margin-bottom: 0;\"> &#8216; Save to Calendar.<br \/>\noAppt.Save()<\/p>\n<p style=\"margin-top: 0; margin-bottom: 0;\">&#160;<\/p>\n<p style=\"margin-top: 0; margin-bottom: 0;\"> &#8216; Display.<br \/>\n&#8216;oAppt.Display(true)<\/p>\n<p style=\"margin-top: 0; margin-bottom: 0;\">&#160;<\/p>\n<p style=\"margin-top: 0; margin-bottom: 0;\"> &#8216; Logoff.<br \/>\noNS.Logoff()<\/p>\n<p style=\"margin-top: 0; margin-bottom: 0;\">&#160;<\/p>\n<p style=\"margin-top: 0; margin-bottom: 0;\"> &#8216; Clean up.<br \/>\noApp = Nothing<br \/>\noNS = Nothing<br \/>\noAppt = Nothing<br \/>\nEnd Sub<\/p>\n<p style=\"margin-top: 0; margin-bottom: 0;\">&#160;<\/p>\n<p style=\"margin-top: 0; margin-bottom: 0;\">End Module\n<\/p>\n<p style=\"margin-top: 0; margin-bottom: 0\">&#160;<\/p>\n<p style=\"margin-top: 0; margin-bottom: 0;\">&#160;<\/p>\n<p style=\"margin-top: 0; margin-bottom: 0;\">&#160;  <\/p>\n<p style=\"margin-top: 0; margin-bottom: 0;\">&#160; <\/p>\n<p style=\"margin-top: 0; margin-bottom: 0;\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>I decided I wanted to do the regular Windows to Outlook side of the project first.&#160; It makes sense having both, as I often change my sets in the morning, in front of my desktop computers. &#160; So I wanted to figure out how to create an Outlook item.&#160; I started with this article: &#160; [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11],"tags":[],"class_list":["post-1113","post","type-post","status-publish","format-standard","hentry","category-projects"],"_links":{"self":[{"href":"https:\/\/kweaver.org\/cs\/wp-json\/wp\/v2\/posts\/1113","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/kweaver.org\/cs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kweaver.org\/cs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kweaver.org\/cs\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/kweaver.org\/cs\/wp-json\/wp\/v2\/comments?post=1113"}],"version-history":[{"count":0,"href":"https:\/\/kweaver.org\/cs\/wp-json\/wp\/v2\/posts\/1113\/revisions"}],"wp:attachment":[{"href":"https:\/\/kweaver.org\/cs\/wp-json\/wp\/v2\/media?parent=1113"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kweaver.org\/cs\/wp-json\/wp\/v2\/categories?post=1113"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kweaver.org\/cs\/wp-json\/wp\/v2\/tags?post=1113"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}