Closed JohnnyZhang0628 closed 3 years ago
Yes, NetOffice requires the Microsoft Office to be installed on the machine where you use these libraries.
I install MS Office 2007, it throw an exception . this is my code:
using (var word = new Application())
{
Document document = null;
try
{
document = word.Documents.Open(Path.Combine(Directory.GetCurrentDirectory(), "111.doc"));
document.ExportAsFixedFormat(Path.Combine(Directory.GetCurrentDirectory(), "222.pdf"), NetOffice.WordApi.Enums.WdExportFormat.wdExportFormatPDF);
}
catch (Exception e)
{
Console.WriteLine($"Message:{e.Message},InnerException.Message:{ e.InnerException.Message}");
}
finally
{
document.Close(false);
word.Quit();
}
}
Console.WriteLine("done");
Console.ReadKey();
OS:win7
NetOffice Version:1.8.1
MS Office:2007
Hello,I test it on Win7 that it not install MS Office ,it not work .So i not sure NetOffice depend MS Office?