专注收集记录技术开发学习笔记、技术难点、解决方案
网站信息搜索 >> 请输入关键词:
您当前的位置: 首页 > vbScript

页面下载功能的实现解决思路

发布时间:2010-05-20 14:01:29 文章来源:www.iduyao.cn 采编人员:星星草
页面下载功能的实现
想做一个下载功能的实现,点击页面中的下载按钮,就可以实现将页面的文字保存到word里进行下载。

------解决方案--------------------
直接用word打开,然后存成.doc文件就可以了。

protected void ConvertToHtml(string SrcFilePath,string TargetFilePath)
{
Word.Application app=new Word.Application();
app.Visible=false;
Object o=Missing.Value;
object docFile=SrcFilePath;
_Document doc=app.Documents.Open(ref docFile,ref o,ref o,ref o,ref o,ref o,ref o,ref o,ref o,ref o,ref o,ref o,ref o,ref o,ref o);
object fileName=TargetFilePath;
object format=Word.WdSaveFormat.wdFormatDocument; //word format
doc.SaveAs(ref fileName,ref format,ref o,ref o,ref o,ref o,ref o,ref o,ref o,ref o,ref o,ref o,ref o,ref o,ref o,ref o);
object t=true;
app.Quit(ref t,ref o,ref o);
}
 
友情提示:
信息收集于互联网,如果您发现错误或造成侵权,请及时通知本站更正或删除,具体联系方式见页面底部联系我们,谢谢。

其他相似内容:

热门推荐: