Accessing Microsoft Outlook from MSD Axapta using COM

Accessing Microsoft Outlook from Axapta using COM
The Business Connector also referred to as the COM connector can be used to integrate Axapta with an external product. In this example Microsoft Outlook is accessed from Axapta using COM. To use this example you must have at least one licensed COM user.

 static void Classes_ReadFromOutlook(Args _args)  
 SysOutlookApplication sysOutlookApplication;  
 SysOutlook_NameSpace sysOutlookNameSpace;  
 SysOutlookMapiFolder sysOutlookMapiFolder;  
 SysOutlook_Folders sysOutlookFolders;  
 SysOutlook_Items collection;  
 COM message;  
 Notes messagebody;  
 sysOutlookApplication = new sysOutlookApplication();  
 sysOutlookNameSpace = sysOutlookApplication.getNameSpace("c");  
 sysOutlookFolders = sysOutlookNameSpace.Folders();  
 sysOutlookMapiFolder =  
 collection = sysOutlookMapiFolder.Items();  
 message = collection.GetFirst();  
 while (message)  
 message = collection.GetNext();