如何在delphi5中实现对word文档页眉的设置?
2006-02-04 14:17:04 来源:WEB开发网核心提示: 我这有一个对当前页面的设置代码var mmm,nnn,aaa:OleVariant;begin mmm:=wdLine; nnn:=1; aaa:=wdFieldPage; WordApp.ActiveWindow.ActivePane.View.SeekView :=wdSeekCurrentPageHea
我这有一个对当前页面的设置代码
var
mmm,nnn,aaa:OleVariant;
begin
mmm:=wdLine;
nnn:=1;
aaa:=wdFieldPage;
WordApp.ActiveWindow.ActivePane.View.SeekView :=wdSeekCurrentPageHeader ;
WordApp.Selection.Move(mmm,nnn);
WordApp.Selection.ParagraphFormat.Alignment := wdAlignParagraphCenter;
WordApp.Selection.InsertAfter('第');
mmm:=wdCharacter;
WordApp.Selection.Move(mmm,nnn);
WordApp.Selection.Fields.Add(WordApp.Selection.Range,aaa,mmm,nnn);
aaa:=wdFieldNumPages;
WordApp.Selection.InsertAfter('页/第');
WordApp.Selection.Move(mmm,nnn);
WordApp.Selection.Fields.Add(WordApp.Selection.Range,aaa,mmm,nnn);
WordApp.Selection.InsertAfter('页');
WordApp.ActiveWindow.ActivePane.View.SeekView := wdSeekMainDocument;
end;
可是只能修改第一页的,怎么修改后面的页面的页眉?
赞助商链接