0
我正在使用Visual Studio 2010. C#编程语言; .NET框架4.0 为了阅读Word文档,我使用了NetOffice 1.5.1.2库。
在我的控制器:NetOffice-将word文档读取为HTML
NetOffice.Factory.Initialize();
// open word and an existing document
NetOffice.WordApi.Application wordApplication = new NetOffice.WordApi.Application();
NetOffice.WordApi.Document newDocument = wordApplication.Documents.Open(@"C:\myWordFile.docx");
// read text of document
string text= newDocument.Content.Text;
// close word and dispose reference
wordApplication.Quit();
wordApplication.Dispose();
但是,文本只是纯文本。我需要的是在浏览器中显示的HTML文本与word文档中完全相同的格式。包括表格,字体,...
我不知道该怎么做。任何帮助,请!
非常感谢。