delphi 匯出WORD,如何在頁腳處顯示‘共X頁 第Y頁“ ,我錄制宏,但代碼在DELPHI 里無法運行。
懇請有懂的幫助,先謝了。
uj5u.com熱心網友回復:
//-------------------生成頁眉頁腳并寫入資料----------
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;
uj5u.com熱心網友回復:
頁眉頁腳,這個好弄,我的錄制的宏是這樣 的
oword.NormalTemplate.AutoTextEntries("第 X 頁 共 Y 頁").Insert(Where:=oword.Selection. Range, RichText:=True)
這局再Delphi怎么寫。
轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/86093.html
標籤:非技術區
