CodePlexProject Hosting for Open Source Software
Home Outlook_ExampleOverview Outlook_Example01
/* list inbox folder in Outlook taken from Example01.csproj */ private void Example01Main() { // Initialize Api COMObject Support LateBindingApi.Core.Factory.Initialize(); // start outlook Outlook.Application outlookApplication = new Outlook.Application(); // Get inbox Outlook._NameSpace outlookNS = outlookApplication.GetNamespace("MAPI"); Outlook.MAPIFolder inboxFolder = outlookNS.GetDefaultFolder(OlDefaultFolders.olFolderInbox); // setup gui listView1.Items.Clear(); labelItemsCount.Text = string.Format("You have {0} e-mails.", inboxFolder.Items.Count); // we fetch the inbox folder items Outlook._Items items = inboxFolder.Items; COMObject item = null; int i = 1; do { if(null == item) item = items.GetFirst(); // not every item is a mail item Outlook.MailItem mailItem = item as Outlook.MailItem; if (null != mailItem) { ListViewItem newItem = listView1.Items.Add(mailItem.SenderName); newItem.SubItems.Add(mailItem.Subject); } item.Dispose(); item = items.GetNext(); i++; } while (null != item); // close outlook and dispose outlookApplication.Quit(); outlookApplication.Dispose(); }
Last edited May 26, 2011 at 12:24 AM by SebastianDotNet, version 2
Very nice framework. But there should be much more support for the deployment of Add-Ins (for example a wizzard). The described way ... (more)
This toolkit is absolutely brilliant. I converted a considerable amount of VBA code to automate interactions between MS-Project and ... (more)
Sign in to join this project.
Excel-DNA