I want to open a single docx file and then convert it to a pdf file in asp.net using the Microsoft.Office.Interop.Word package.
This is my code written in asp button click event ...
object fileFormat = Microsoft.Office.Interop.Word.WdSaveFormat.wdFormatPDF; Object missing = Type.Missing; object saveName = strURL.Replace(".docx", ".pdf"); object openName = docPath + "\\T4.docx"; Microsoft.Office.Interop.Word.Application wdApp = new Microsoft.Office.Interop.Word.Application(); Microsoft.Office.Interop.Word.Document doc = wdApp.Documents.Open(openName,missing,missing,missing,missing,missing,missing,missing,missing,missing,missing,missing,missing,missing,missing,missing); doc.SaveAs(saveName,fileFormat,missing,missing,missing,missing,missing,missing,missing,missing,missing,missing,missing,missing,missing,missing); doc.Close(ref missing, ref missing, ref missing);
But when running wdApp.Documents.Open () , problems arise.
A browser symbol is like loading always ...
I do not know what is the reason for the cause of this error ... please help me ...