I'm trying to create, open, read/write to/from .docx files from a windows 8.1 universal App. I'm using Visual Studio 2013.
When I initialize a Interop.Word.Application
Microsoft.Office.Interop.Word.Application application = new Microsoft.Office.Interop.Word.Application();
I get an error
An exception of type 'System.Runtime.InteropServices.COMException' occurred in mscorlib.dll but was not handled in user code
Additional information: Creating an instance of the COM component with CLSID
{000209FF-0000-0000-C000-000000000046} using CoCreateInstanceFromApp failed due
to the following error: 80040154 Class not registered (Exception from HRESULT:
0x80040154 (REGDB_E_CLASSNOTREG)). Please make sure your COM object is in the
allowed list of CoCreateInstanceFromApp.
I have looked around and haven't been able to find anything that matches my problem. I've seen this exception for insufficient permissions, but I've run as admin, and no luck.
Any help is appreciated. Let me know if you need more information.
EDIT 1
I did do something weird while creating this app. I wasn't able to add a reference to Microsoft.Office.Interop the way I've been able to in the past, so I followed some instructions I found online, and added them by just pointing to
C:\Program Files (x86)\Microsoft Visual Studio 12.0\Visual Studio Tools for Office\PIA\Office15\Microsoft.Office.Interop.Word.dll
I'm not sure if that helps, but it was the only thing that I did that seemed abnormal.