网络编程 | 站长之家 | 网页制作 | 图形图象 | 操作系统 | 冲浪宝典 | 软件教学 | 网络办公 | 邮件系统 | 网络安全 | 认证考试 | 系统进程
Firefox | IE | Maxthon | 迅雷 | 电驴 | BitComet | FlashGet | QQ | QQ空间 | Vista | 输入法 | Ghost | Word | Excel | wps | Powerpoint
asp | .net | php | jsp | Sql | c# | Ajax | xml | Dreamweaver | FrontPages | Javascript | css | photoshop | fireworks | Flash | Cad | Discuz!
当前位置 > 网站建设学院 > 网络编程 > Delphi
Tag:注入,存储过程,分页,安全,优化,xmlhttp,fso,jmail,application,session,防盗链,stream,无组件,组件,md5,乱码,缓存,加密,验证码,算法,cookies,ubb,正则表达式,水印,索引,日志,压缩,base64,url重写,上传,控件,Web.config,JDBC,函数,内存,PDF,迁移,结构,破解,编译,配置,进程,分词,IIS,Apache,Tomcat,phpmyadmin,Gzip,触发器,socket
网络编程:ASP教程,ASP.NET教程,PHP教程,JSP教程,C#教程,数据库,XML教程,Ajax,Java,Perl,Shell,VB教程,Delphi,C/C++教程,软件工程,J2EE/J2ME,移动开发
本月文章推荐
.COM程序编写入门(全文-1).
.利用热键控制鼠标移动的一个程序.
.DEPHI发布时免安装环境.
.如何将C/C++程序转译成Delphi(二).
.程序字体,我们自已选.
.Delphi4的Winsocket编程.
.截获Delphi中的异常.
.用DEPHI为应用软件建立注册机制.
.DLL文件中Form的使用.
.delphi多线程程序示例(与.net一样.
.在Delphi中通过函数获取GUID.
.回调函数与Delphi的事件模型.
.[Tips]设置双击时间.
.程序间参数传递.
.华为CMPP源码delphi6版.
.用InstallShield制作数据库应用系.
.在Delphi中使用指针参数.
.datatree和数据库绑定的最少代码.
.关于中文折行及相关问题的解决方.
.在DELPHI中用线程排序.

Delphi操作Wrod的几个知识点

发表日期:2006-2-4


 

//-------------------初始化--------------------

 var
  wApp,work:Variant;

  try
   wApp:=GetActiveOleObject('word.Application');
  except
   wApp:=CreateOleObject('word.Application');
  end;

//---------------替换字符--------------------

  wApp.selection.find.text:='<%a2%>';
  wApp.selection.find.replacement.text:=lb;
  wApp.selection.find.execute(replace:=wdReplaceAll);

//----------------------隐藏WORD菜单和工具栏----------------------

if OC.State in [osUIActive]  then 
 begin
  OC.OleObjectInterface.QueryInterface(IOleInPlaceObject,IOO);
  IOO.UIDeactivate;
  IOO :=nil;
 end;

//-----------------根据书签导数据------

 wApp.Selection.GoTo(What:=wdGoToBookmark,Name:='ZCZD'+IntToStr(i));
  wApp.Selection.typetext('■')

//-------------------生成页眉页脚并写入数据----------

  wApp.Selection.GoTo(What:=wdGoToPage, Which:=wdGoToNext, Name:='FLAG');
  If wApp.ActiveWindow.View.SplitSpecial <> wdPaneNone Then
      wApp.ActiveWindow.Panes(2).Close;
  If (wApp.ActiveWindow.ActivePane.View.Type = wdNormalView) Or (wApp.ActiveWindow.ActivePane.View.Type = wdOutlineView) Then
      wApp.ActiveWindow.ActivePane.View.Type := wdPrintView;
  wApp.ActiveWindow.ActivePane.View.SeekView := wdSeekCurrentPageHeader;
  wApp.Selection.ParagraphFormat.Borders.item(wdBorderLeft).LineStyle := wdLineStyleNone;
  wApp.Selection.ParagraphFormat.Borders.item(wdBorderRight).LineStyle := wdLineStyleNone;
  wApp.Selection.ParagraphFormat.Borders.item(wdBorderTop).LineStyle := wdLineStyleNone;
  wApp.Selection.ParagraphFormat.Borders.item(wdBorderBottom).LineStyle := wdLineStyleNone;
  wApp.ActiveWindow.ActivePane.View.SeekView := wdSeekCurrentPageFooter;
  wApp.Selection.ParagraphFormat.Alignment := wdAlignParagraphRight;
  if (DM.XM_DS.FieldByName('tg_flag').AsInteger = 2) and (DM.XM_DS.FieldByName('tj_flag').AsInteger = 0) then
    wApp.Selection.TypeText(Text:='合`格`任`务`书')
  else
    wApp.Selection.TypeText(Text:='不合格任务书');
  wApp.ActiveWindow.ActivePane.View.SeekView := wdSeekMainDocument;


上一篇:从DBGrid,StringGrid导出Excel 人气:6131
下一篇:扫雷外挂的设计与实现(三) 人气:3949
浏览全部Delphi的内容 Dreamweaver插件下载 网页广告代码 祝你圣诞节快乐 2009年新年快乐