A InfoWiki wikiből
(Változatok közti eltérés)
30. sor: | 30. sor: | ||
} | } | ||
</code> | </code> | ||
+ | |||
+ | <alairas>Hernyák Zoltán</alairas> |
A lap 2009. január 16., 08:33-kori változata
C# program az Outlook Calendar elemek kiolvasására
Előtte adjuk hozzáa az References részben az Microsoft Outlook 12.0 Object Library-t (msoutl.olb). Ez két References bejegyzést készít, az Microsoft.Office.Core-t, és a Microsoft.Office.Interop.Outlook-t.
using System; using System.Collections.Generic; using System.Text; using Microsoft.Office.Interop.Outlook; namespace ConsoleApplication1 { class Program { static void Main(string[] args) { Application objOutlook = new ApplicationClass(); NameSpace objNS = objOutlook.GetNamespace("MAPI"); objNS.Logon("", "", false, true); // MAPIFolder mf = objNS.GetDefaultFolder(OlDefaultFolders.olFolderCalendar); for (int i = 1; i <= mf.Items.Count; i++) { AppointmentItem ai = (AppointmentItem)mf.Items[i]; Console.WriteLine("{0} - {1} / {2}",ai.Subject, ai.Start,ai.Body); } Console.ReadLine(); } } }
Hernyák Zoltán