PDA

View Full Version : Is there an 'Import' Method in Outlook VBA



NDGUK
08-25-2011, 04:50 PM
I note on this forum and others that the 'standard' solution to importing contacts say from Excel into Outlook (with optional Distribution Lists) using VBA is to drive the process from Excel and loop through the spreadsheet rows adding recipients etc.

Within Outlook having exposed the contacts view and then using the File > Import and Export sequence one can import from various formats including Excel 2003 Compatible format files with a named range defined. I have successfully performed this for two specific sets of contacts. I also managed to map an input column to the 'categories' field which then ostensibly becomes my single character 'distribution list' identifier in the contacts 'categories' view. Sometime later I want to be able to program the selection of contact email addresses based on the category values.

Now I want a minimum maintenance solution to replicate the import process within an Outlook macro without having to expose Excel and loop through the rows!

So my question is how is the 'import' tool implemented and how come I cannot find any references in Outlook VBA documentation on how to exploit it?

Using Windows XP & 7 plus MS Office 2007.

Any help out there greatly welcomed!

JP2112
08-29-2011, 08:27 AM
The Outlook Object Model is pretty poor compared to other object models, there's a lot you simply can't access or automate. Workarounds are often required.