
- #OUTLOOK EMAIL ADDRESS EXTRACTOR HOW TO#
- #OUTLOOK EMAIL ADDRESS EXTRACTOR CODE#
- #OUTLOOK EMAIL ADDRESS EXTRACTOR PC#
Save Emails from Contacts to Contact FolderĮxtracts email addresses from Outlook contacts to the selected contact folder. Saves specified properties from Outlook addresses to a text file.Įxtracts email addresses from Outlook address books to the contact folder.Įxtracts email addresses from Outlook address books to the contact group. Saves specified properties from Outlook address books to a text file. Saves email addresses from Outlook messages to NK2 or XML autocomplete list cache files.
#OUTLOOK EMAIL ADDRESS EXTRACTOR HOW TO#
The links below provide more information on how to use the Outlook Interop service.Export Emails from Messages to Auto-Complete Files
#OUTLOOK EMAIL ADDRESS EXTRACTOR CODE#
I've tested this code on mailboxes hosted with an on-premises Exchange 2013 environment, Office 365 and a POP3/IMAP mailbox as well - all functioning exactly the same. Outlook.Folders subFolders = folder.Folders įolder = subFolders] as Outlook.Folder String folders = folderPath.Split(backslash.ToCharArray()) įolder = ] as Outlook.Folder įor ( int i = 1 i <= folders.GetUpperBound( 0) i++) Returns Folder object based on folder path static Outlook.Folder GetFolder( string folderPath)Ĭonsole.WriteLine( " Looking for: " + folderPath) Int tempEmailAddressCount = emailAddressesCounter ĮmailAddressesCounter = emailAddressesCounter ĮmailAddressesCounter = tempEmailAddressCount String tempEmailAddress = emailAddresses String extensionsArray = '", e) įor ( int i = 0 i = 1 & Int32.Parse(response.Trim()) 0) Static void IterateMessages(Outlook.Folder folder) Call EnumerateFolders using childFolder, // to see if there are any sub-folders within this oneĬonsole.WriteLine( " Checking in " + folder.FolderPath) We only want Inbox folders - ignore Contacts and others if (( " Inbox"))Ĭonsole.WriteLine(childFolder.FolderPath) Outlook.Folders childFolders = folder.Folders įoreach (Outlook.Folder childFolder in childFolders) static void EnumerateFolders(Outlook.Folder folder) Uses recursion to enumerate Outlook subfolders. Outlook.Folder root = () as Outlook.Folder Outlook.Application Application = new Outlook.Application() Static void EnumerateFoldersInDefaultStore() EnumerateFoldersInDefaultStore() // Console.WriteLine("Total file size:" + totalfilesize) Public static List emailAddressesCounter = new List() Array to store email addresses and counts public static List emailAddresses = new List() If (emailAddress.Contains( " & emailAddress.Contains( ". Static void add_address_to_list( string emailAddress) Outlook.Recipients recipients = olMailItem.Recipients įoreach (Outlook.Recipient recipient in recipients) To do this, we simply iterate through the collection. The root folder is in the format \\foldername\, and the inbox is located one level below this, at \\foldername\Inbox\. Iterating through Outlook Accountsīefore we can go through each folder and email in Outlook, we need to find an actual account, and build the root folder from this.
#OUTLOOK EMAIL ADDRESS EXTRACTOR PC#
You also need to have Microsoft Outlook installed on your PC - otherwise the Interop assembly has nothing to talk to. It extends the Outlook 20 Developer Reference from the COM environment to the managed environment, allowing to you interact with Outlook from a. The Outlook Primary Interop Assembly (PIA) Reference provides help for developing managed applications for Outlook 20. The application makes use of the assembly, so you'll need to add this as a reference in your project. Prerequisitesįirstly, create a C# console application in Visual Studio, targeting the. It is relatively trivial to exclude your own email address - simply ammend the add_address_to_list() function to check for your address and not add it if found.

One limitation is that your email address is likely to be in the list of recipients (how else would you have received the message!), so it is likely your address will have the highest counter value.
