Late binding for Outlook PIA

127 Views Asked by At

I have been working with Outlook PIA . I have used early binding and added reference to Outlook PIA 2010 that works fine with Outlook 2013 as well Outlook 2010. But What i need is if Outlook is 2013 then used Outlook PIA for 2013and if Outlook is 2010 then use Outlook 2010 PIA. Is their any way to do this?

Or I have gone through forums suggesting Late binding for Outlook to make it version independent.

And when to use late binding?

1

There are 1 best solutions below

0
On

At the installation time you can check which Outlook version is installed in the system and deploy only the corresponding interop libraries.

But a widely spread solution is to use the lowest interop version. Thus, you will be sure that methods and properties supported in Outlook 2010 are used in the code, so your solution can be easily run in the lowest Outlook version. When required, you can use the late-biding technology for accessing properties and methods not listed in interop assemblies (see Type.InvokeMember for more information).

Finally, you may find all things explained in the Supporting several Office versions in an add-in. Interop assemblies and late binding. article.