Home > Back-end > Delphi export WORD, how to display 'X pages in the footer first page Y"
Delphi export WORD, how to display 'X pages in the footer first page Y"
Time:09-27
Delphi export WORD, how to display "X pages in the footer first page Y", I record macro, but cannot run code in Delphi, Kindly understand the help, thanks.
CodePudding user response:
//-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- to generate the header, footer and write data -- -- -- -- -- -- -- -- -- --
WApp. Selection. GoTo (credit:=wdGoToPage, Which:=wdGoToNext, Name:='FLAG'); If wApp. ActiveWindow. The SplitSpecial & lt;> WdPaneNone Then WApp. ActiveWindow. Panes (2). The Close; If (wApp. ActiveWindow. ActivePane. View. Type=wdNormalView) Or (wApp. ActiveWindow. ActivePane. The Type=wdOutlineView) Then WApp. ActiveWindow. ActivePane. View. Type:=wdPrintView; WApp. ActiveWindow. ActivePane. View. SeekView:=wdSeekCurrentPageHeader; WApp. Selection. ParagraphFormat. Borders. Item (wdBorderLeft). Graphics.linestyle:=wdLineStyleNone; WApp. Selection. ParagraphFormat. Borders. Item (wdBorderRight). Graphics.linestyle:=wdLineStyleNone; WApp. Selection. ParagraphFormat. Borders. Item (wdBorderTop). Graphics.linestyle:=wdLineStyleNone; WApp. Selection. ParagraphFormat. Borders. Item (wdBorderBottom). Graphics.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:='us ` ren ` ` grid services ` books') The else WApp. Selection. TypeText (Text:='unqualified specification'); WApp. ActiveWindow. ActivePane. View. SeekView:=wdSeekMainDocument;