码迷,mamicode.com
首页 > Web开发 > 详细

web打印word

时间:2015-06-16 14:28:33      阅读:239      评论:0      收藏:0      [点我收藏+]

标签:

需要引用 Aspose.Words.dll

 

Document doc = new Document(Server.MapPath("./docs/个人口腔医疗服务协议(2015版)- 系统打印模板.docx"));
                        DocumentBuilder builder = new DocumentBuilder(doc);
                    


                            Bookmark name;

                            if (doc.Range.Bookmarks["name"] != null)
                            {
                                name = doc.Range.Bookmarks["name"];
                                name.Text = "236";
                            }


                            doc.Save(Path + 3 + ".doc", SaveFormat.Doc);

                            Response.ContentType = "/doc";
                            Response.AppendHeader("Content-Disposition", "attachment; filename=3.docx");
                            Response.TransmitFile(Server.MapPath("./exportword/3.docx"));
                            Response.End();

web打印word

标签:

原文地址:http://www.cnblogs.com/110abcd/p/4580531.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!