We have a code written for outlook 2010.
When we run it on a computer using outlook 2003, we get an error.
We are trying to resolve user names by using Outlook.namespace GetSelectNamesDialog function
and the following exception appears when outlook 2003 is installed:
Exception Info :System.accessviolationexception.
Stack:
at Microsoft.Office.Interop.Outlook._NameSpace.GetSelectNamesDialog()
Is there any way that our code will work for both 2010 and 2003?
for now, it works just for outlook 2010.
you can implement 2 classes. one for 2010 and the other for 2003. make an interface of OutlookExchange with 3 function :send,resolve and close. those 2 classes will Inheritance from OutlookExchange. you need to check what is the outlook version that installed in your computer explnation in the next link How to detect installed version of MS-Office? , and use the class according to the version like that: