目前我就是想打开html文档,然后再另存为doc格式文档,但效果非常不理想。
//打开文件
object fileName = @"c:\1.html";
object objMissing = Missing.Value;
object fileFormat = Microsoft.Office.Interop.Word.WdSaveFormat.wdFormatDocument;
Microsoft.Office.Interop.Word.Document dc = word.Documents.Open(ref fileName, ref objMissing, ref objMissing, ref objMissing, ref objMissing, ref objMissing, ref objMissing, ref objMissing, ref objMissing, ref fileFormat, ref objMissing, ref objMissing, ref objMissing, ref objMissing, ref objMissing, ref objMissing);
//另存为,转换格式
object saveFileName = @"C:\new.doc";
fileFormat = Microsoft.Office.Interop.Word.WdSaveFormat.wdFormatRTF;
dc.SaveAs(ref saveFileName, ref fileFormat, ref objMissing, ref objMissing, ref objMissing, ref objMissing, ref objMissing, ref objMissing, ref objMissing, ref objMissing, ref objMissing, ref objMissing, ref objMissing, ref objMissing, ref objMissing, ref objMissing);
//退出。略。