国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 編程 > Delphi > 正文

Delphi操作Wrod的幾個知識點

2019-11-18 18:01:41
字體:
來源:轉載
供稿:網友
 

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

 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;



上一篇:如何在delphi5中實現對word文檔頁眉的設置?

下一篇:在Delphi中利用CreateRemoteThread遠程注入例子

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
學習交流
熱門圖片

新聞熱點

疑難解答

圖片精選

網友關注

主站蜘蛛池模板: 塘沽区| 平罗县| 星子县| 罗源县| 柘城县| 赣州市| 龙游县| 阳朔县| 五台县| 威宁| 盘山县| 哈尔滨市| 靖远县| 调兵山市| 怀宁县| 襄樊市| 宜城市| 景东| 平塘县| 鹿邑县| 什邡市| 南雄市| 北安市| 巴青县| 富阳市| 铜梁县| 武功县| 牡丹江市| 南平市| 宣化县| 盖州市| 永定县| 香河县| 乌兰察布市| 玉屏| 梅州市| 榆林市| 宾川县| 大洼县| 台安县| 太湖县|