InteropServices.ComException error when trying to open a word doc in c#

0

When i run

private void Print_Click(object sender, EventArgs e)
{
    var application = new Microsoft.Office.Interop.Word.Application();
    var document = new Microsoft.Office.Interop.Word.Document();

    document = application.Documents.Add(Template: @"C:\Office\Word\Templates\AttNoteEN.dotm");

    application.Visible = true;
}

i get the below message. i have the reference in for the office interop but i still get this message.

System.Runtime.InteropServices.COMException: 'Retrieving the COM class factory for component with CLSID {000209FF-0000-0000-C000-000000000046} failed due to the following error: 80080005 Server execution failed (Exception from HRESULT: 0x80080005 (CO_E_SERVER_EXEC_FAILURE)).'

c#
windows
asked on Stack Overflow Feb 24, 2020 by Matthew Rodwell • edited Feb 24, 2020 by James Z

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0