What is the difference between Microsoft.Office.Interop. * Versions 12 and 14?

I installed Visual Studio 2010 and Office 2007. When I go to Add Link and search for Office Interop , I see that each of the links appears twice with versions 12 and 14.

First I tried version 14 of Microsoft.Office.Interop.Wordand did a quick test. Initialize the application, open the document, close the document, close the application, and release the COM object. My test was a simple WinForms program in C # 4.0.

WINWORD.EXE crashed while closing a document.

I switched the link to version 12 and left my code exactly as it was, and tried it again. Everything worked fine.

Since then I have written the rest of my code using version 12 and have not had any problems.

So, now I'm curious: there are slight differences between publicly exposed members Microsoft.Office.Interop.*in versions 12 and 14, but basically there are a lot of overlaps.

What is the difference? Why did my simple test fail even though I have a relatively new version of Office? and is there a rule about which version the developer should choose when starting the interop project?

+5
source share
1 answer

Version 12 is interop for Office 2007, and 14 for Office 2010. AFAIK, if you really do not need the new features of version 14, you can use the lower version of the interop library, and it will work fine for all newer versions of Office.

+13
source

All Articles