首页 新闻 会员 周边

asp.net类似百度文库一样显示

0
悬赏园豆:100 [已解决问题] 解决于 2013-08-19 13:08

object fileName = ""+WebHelp.GetMapPath("20130806-0809.doc");
object saveFileName = "e:\\路径\\sss.swf";

Word.ApplicationClass word = new Word.ApplicationClass();
Word.Documents docs = word.Documents;// 打开文件
Type wordType = word.GetType();
Type docsType = docs.GetType();
Word.Document doc = (Word.Document)docsType.InvokeMember("Open", System.Reflection.BindingFlags.InvokeMethod, null, docs, new Object[] { fileName, true, true });
Type docType = doc.GetType();// 转换格式,另存为
docType.InvokeMember("SaveAs", System.Reflection.BindingFlags.InvokeMethod, null, doc, new object[] { saveFileName, Word.WdSaveFormat.wdFormatWebArchive });//wdFormatHTML(网页);wdFormatWebArchive(mht网页)
wordType.InvokeMember("Quit", System.Reflection.BindingFlags.InvokeMethod, null, word, null);//退出 Word

求大神解答,这样能出来,但是给我的感觉就是强制的修改了后缀名导致文件无法打开

哪位大神做过类似的功能

D调灬仔的主页 D调灬仔 | 初学一级 | 园豆:90
提问于:2013-08-16 17:06
< >
分享
最佳答案
0

哦 我好想自己搞出来了 但不完美

D调灬仔 | 初学一级 |园豆:90 | 2013-08-19 13:07
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册