So, can i import data into a .NET application from all versions of Outlook using that namespace, or i can import only from Outlook 2010? Does anyone know.
According to MSDN
"Starting in Microsoft Office Outlook 98, Microsoft Outlook provides an object model for developers to integrate Outlook functionality into an application, extend Outlook, or automate Outlook."
I have not personally used Interop.Outlook, but based on that I'd assume you should be able to go back to 98. You may have to use an older version of Visual Studio however.
Microsoft.Office.Interop.Outlook
is the primary interop assembly (PIA) for Outlook and can be used to automate all versions of Outlook from Outlook XP onwards. Note that you can only have one version installed on your system at a time given the Office PIA assembly redirection policy. The PIA for Outlook 2010 will likely expose COM interfaces that do not exist in previous versions of Outlook so it is best to make sure you only have the lowest version of the Outlook PIA you are targeting installed in the Global Assembly Cache on your development (and deployment) machines in order to avoid inadvertantly calling undefined methods or querying for undefined interfaces in older versions of Outlook. In practical terms, you need to make sure you only have the oldest version of Outlook you care about installed on your system.
- Outlook 2010: version 14.0.0.0 of PIAs (download)
- Outlook 2007: version 12.0.0.0 of PIAs (download)
- Outlook 2003: version 11.0.0.0 of PIAs (download)
- Outlook XP: version 10.0.0.0 of PIAs (download)
No PIAs existed for versions of Outlook prior to XP (though one could probably be generated using tlbimp
). The underlying COM interfaces existed in Outlook 98 but no PIAs were provided at that point since this predated the .NET Framework.