doc文档的web查看
1.doc文档的查看是这样的需要转换成html,保存路径,直接打开html浏览
2.应用Microsoft.Office.Interop.Word组件
3.操作代码
object filePath = Server.MapPath("doc文件相对路径");
object readOnly = true;
object addToRecentFiles = false;
object confirmConversion = false;
object revert = true;
object visible = false;
object formate = WdSaveFormat.wdFormatFilteredHTML;
object missing = System.Reflection.Missing.Value;
object savePath = Server.MapPath("保存目录/"+fileName.Replace("doc的后缀名","html"));
object saveChanges = false;
//word引用程序
Application word = new Application();
//打开一个文档
Document doc = word.Documents.Open(ref filePath,
ref confirmConversion, ref readOnly, ref addToRecentFiles, ref missing, ref missing, ref revert, ref missing, ref missing, ref missing, ref missing,
ref visible, ref missing, ref missing, ref missing, ref missing);
//另存为网页格式
doc.SaveAs(ref savePath, ref formate, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing);
word.Quit(ref saveChanges, ref missing, ref missing);