I am trying to fix this legacy app that was created using Visual Studio 2003, using Microsoft Office Interops version 11, .NET 2.0. I am trying to fix it in Visual Studio Express 2010 to reference Interops version 14, .NET 4.0 -- as noted in my previous question on StackOverflow, the legacy app works fine in Windows 7 but after I close it, the Microsoft Office products are crashing when I try to use them.
However, when I fix the references in VS2010 (delete old v.11 Interops, add in new v.14 Interops) and then attempt to publish the application, I get errors like
'Microsoft.Office.Interop.Word.System does not contain a definition for IO'
It looks like VS2010 does not see my System namespace being used when the Word namespace is referenced? When I removed the
using Microsoft.Office.Interop.Word
namespace and then try to publish, the errors like the above disappear and I only get the expected errors related to the missing Word reference like
The type or namespace name '_Document' could not be found (are you missing a using directive or an assembly reference?)
I already included the System.dll in the reference so I'm not sure what's going on? Thanks for reading!
EDIT: I made "Embeded Interop Types" to be False for the Office Interops. That may have fixed some of the errors? HOWEVER: Visual Studio is still interpreting any System references to be "Microsoft.Office.Interop.Word.System" which is NOT what I want. This error seems to be the dominant one now:
The type name 'Windows' does not exist in the type 'Microsoft.Office.Interop.Word.System'