当前位置: 首页 > news >正文

杭州企业求网站建设盗图来做网站

杭州企业求网站建设,盗图来做网站,网站的服务器,襄阳建设21网站主要功能为根据word模板生成word报表文档,注意引用Interop.Word.dll;首先要生成word程序对象Word.Application app new Word.Application();根据模板文件生成新文件框架File.Copy(TemplateFile, FileName);生成documnet对象ord.Document doc new Word.Document(); 打开…主要功能为根据word模板生成word报表文档,注意引用Interop.Word.dll;首先要生成word程序对象Word.Application app new Word.Application();根据模板文件生成新文件框架File.Copy(TemplateFile, FileName);生成documnet对象ord.Document doc new Word.Document();        打开新文挡        doc app.Documents.Open(ref Obj_FileName, ref missing, ref ReadOnly, ref missing,            ref missing, ref missing, ref missing, ref missing,            ref missing, ref missing, ref missing, ref Visible,            ref missing, ref missing, ref missing,            ref missing);        doc.Activate();将光标定位到新的书签(模板中定义了书签的位置),下面代码为在光标位置输出一行,然后回车        //光标转到书签        for (int bookIndex 0; bookIndex 5; bookIndex)        {            object BookMarkName BookMark bookIndex.ToString();            object what Word.WdGoToItem.wdGoToBookmark;            doc.ActiveWindow.Selection.GoTo(ref what, ref missing, ref missing, ref BookMarkName);            doc.ActiveWindow.Selection.TypeText(文明单位 bookIndex.ToString() zaddd    25      大学);            doc.ActiveWindow.Selection.TypeParagraph();        }输出完毕后,最后关闭doc对象        object IsSave true;        doc.Close(ref IsSave, ref missing, ref missing); 完整事例代码如下: using System;using System.IO;using System.Data;using System.Configuration;using System.Web;using System.Web.Security;using System.Web.UI;using System.Web.UI.WebControls;using System.Web.UI.WebControls.WebParts;using System.Web.UI.HtmlControls;public partial class _Default : System.Web.UI.Page {    protected void Page_Load(object sender, EventArgs e)    {    }    protected void Button1_Click(object sender, EventArgs e)    {        Word.Application app  new Word.Application();        //模板文件        string TemplateFile  D:MyworkExcelReportsServerReportServerTempalteSmallList.doc;        //生成的具有模板样式的新文件        string FileName  C:Documents and SettingsAdministrator桌面  DateTime.Now.ToString(yyyyMMddHHmmssfffffff).doc;        //模板文件拷贝到新文件        File.Copy(TemplateFile, FileName);        Word.Document doc  new Word.Document();        object Obj_FileName  FileName;        object Visible  false;        object ReadOnly  false;        object missing  System.Reflection.Missing.Value;        //打开文件        doc  app.Documents.Open(ref Obj_FileName, ref missing, ref ReadOnly, ref missing,            ref missing, ref missing, ref missing, ref missing,            ref missing, ref missing, ref missing, ref Visible,            ref missing, ref missing, ref missing,            ref missing);        doc.Activate();        //光标转到书签        for (int bookIndex  0; bookIndex  5; bookIndex)        {            object BookMarkName  BookMark  bookIndex.ToString();            object what  Word.WdGoToItem.wdGoToBookmark;            doc.ActiveWindow.Selection.GoTo(ref what, ref missing, ref missing, ref BookMarkName);            doc.ActiveWindow.Selection.TypeText(文明单位  bookIndex.ToString()  zaddd    25      大学);            doc.ActiveWindow.Selection.TypeParagraph();        }        object IsSave  true;        doc.Close(ref IsSave, ref missing, ref missing);        Response.Write(script languagejavascriptalert(生成模板成功!)/script);    }}附:光标到 书签Title 的位置object BookMarkNameTitle;object what Word.WdGoToItem.wdGoToBookmark;Doc.ActiveWindow.Selection.GoTo(ref what ,ref missing,ref missing,ref BookMarkName);                        在当前的光标写文本Doc.ActiveWindow.Selection.TypeText(变更通知); 当前的光标换行Doc.ActiveWindow.Selection.TypeParagraph(); 当前的光标设置格式举例 对齐方式                                                              Doc.ActiveWindow.Selection.ParagraphFormat.AlignmentWord.WdParagraphAlignment.wdAlignParagraphRight; 注意 ParagraphFormat 是设置字体的格式的地方
http://www.pierceye.com/news/22524/

相关文章:

  • 软件工程考研容易上岸的学校关键词seo是什么意思
  • 长沙网站建设大概多少钱杭州高端网建
  • 注册公司登陆哪个网站网站备案类型及条件
  • 南京市住房和城乡建设网站个人网站建设及实现
  • 襄阳官网建站公司什么网站可以做兼职销售
  • 大连 网站制作 外贸网站开发的销售
  • 威海建设局网站楼盘信息公布网站建设多少钱 知乎
  • 网站速度怎么提升做视频网站的备案要求吗
  • 怎么制作企业网站公司网站哪家做的好
  • 乌兰察布市建设工程造价网站山东省级建设主管部门网站
  • 做企业网站找哪家wordpress仿导航大全
  • 手机网站建设 如何获得更好的排名连云港建设工程安全网站
  • 网站交互用什么做新网站制作平台
  • 大唐网站建设大学生求职创业补贴有多少钱
  • 网站的栏目是什么犀牛云做的网站怎么样
  • 夜场建设网站营销与运营的关系
  • 免费网站域名空间163网易企业邮箱格式
  • 请将已备案网站接入访问北京开公司一年费用
  • 徐州做网站的哪个好商标查询网站
  • 网站5建设需要学什么条件wordpress主题接入社交功能
  • 陇南地网站建设网站切换效果
  • 音乐网站可以用什么语言做建立修仙大学
  • 网站建设需求文档模板微信公众号免费做影视网站
  • 网店推广方案范文网站优化就是每天更新内容吗
  • 建网站免费软件宁波市北仑区建设局网站
  • 千博企业网站安徽省在建项目查询
  • 网站编辑器长春网站建设哪个公司好
  • asp.net网站第一次运行慢网页内容修改器
  • 徐州网站关键词推广查企业公司用什么软件
  • html5网站模板 站长网中山网站优化排名