コード例 #1
0
        public IActionResult CreateWord()
        {
            string fileName = Request.Query["fileName"];
            string subject  = Request.Query["subject"];

            PageOfficeNetCore.PageOfficeCtrl pageofficeCtrl = new PageOfficeNetCore.PageOfficeCtrl(Request);
            pageofficeCtrl.ServerPage = "/PageOffice/POServer";

            //添加自定义按钮
            pageofficeCtrl.AddCustomToolButton("保存", "Save()", 1);
            pageofficeCtrl.JsFunction_BeforeDocumentSaved = "BeforeDocumentSaved()";
            //设置保存页面
            pageofficeCtrl.SaveFilePage = "SaveDoc";
            //打开Word文档
            pageofficeCtrl.WebCreateNew("张佚名", PageOfficeNetCore.DocumentVersion.Word2003);
            ViewBag.POCtrl = pageofficeCtrl.GetHtmlCode("PageOfficeCtrl1");
            return(View());
        }