I am getting the following error while using the Interop word dll for converting the Word to PDF.
Error Converting DOC To PDF12066_Parameter.docx Retrieving the COM class factory for component with CLSID {000209FF-0000-0000-C000-000000000046} failed due to the following error: 80070005 Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED)).
Please suggest solutions ASAP.
What I have tried:
string strFileName = "";
strFileName = fuSrc.PostedFile.FileName.ToString();
Application appWord = new Application();
Document wordDocument = appWord.Documents.Open(strFileName);
txtDst.Text = strFileName.Replace(".docx", ".pdf").Replace(".doc", ".pdf");
try
{
wordDocument.ExportAsFixedFormat(txtDst.Text, WdExportFormat.wdExportFormatPDF);
lblErr.Text="Converted Successfully";
}
catch (Exception ex)
{
lblErr.Text=ex.Message.ToString();
}