I have a set code for the current page
var
mmmm,nnn,aaa:OleVariant;
Begin
mmmm:=wdLine;
nnn:=1;
aaa:=wdFieldPage;
WordApp.ActiveWindow.ActivePane.View.SeekView :=wdSeekCurrentPageHeader;
WordApp.Selection.Move(mm,nnn);
WordApp.Selection.ParagraphFormat.Alignment := wdAlignParagraphCenter;
WordApp.Selection.InsertAfter('Part');
mmmm:=wdCharacter;
WordApp.Selection.Move(mm,nnn);
WordApp.Selection.Fields.Add(WordApp.Selection.Range,aaa,mmm,nnn);
aaa:=wdFieldNumPages;
WordApp.Selection.InsertAfter('Page/Chapter');
WordApp.Selection.Move(mm,nnn);
WordApp.Selection.Fields.Add(WordApp.Selection.Range,aaa,mmm,nnn);
WordApp.Selection.InsertAfter('Page');
WordApp.ActiveWindow.ActivePane.View.SeekView := wdSeekMainDocument;
end;
But you can only modify the first page. How to modify the header of the subsequent page?