web打印word

需要引用 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打印)