Jose Saiz

Jose Saiz

  • 1.5k
  • 260
  • 104k

Help with Office.Interop

Nov 10 2018 6:35 AM
Hi Guys,
I am using the following to export MS-WORD documents to PDF and it works great within the visual studio IDE
 
using Microsoft.Office.Interop.Word;
 
public Microsoft.Office.Interop.Word.Document wordDocument { get; set; }
 
Microsoft.Office.Interop.Word.Application appWord = new Microsoft.Office.Interop.Word.Applicatio();
wordDocument = appWord.Documents.Open(@"D:\desktop\xxxxxx.docx");
wordDocument.ExportAsFixedFormat(@"D:\desktop\DocTo.pdf", WdExportFormat.wdExportFormatPDF);
 
My question is, besides deploying the Microsoft.Office.Interop.Word.dll along with the web project, Do I need to have office installed on the (Windows) IIS server where the application will be hosted?
 
Or besides the Microsoft.Office.Interop.Word.dll, do I need some other assamblies in order for the export to work 100%?
 
Also I noticed that when exporting the word document to pdf MS-Word opens the documents and prompt me to open it in read-only mode, is this something that only happen while testing on visual studio IDE or it will also occur after deployed.
 

I will appreciate as much answer as you can provide 
 
 
 

Answers (1)