Ich habe einen festgelegten Code für die aktuelle Seite
var
mmmm, nnn, aaa: olevariant;
Beginnen
mmmm: = wdline;
nnn: = 1;
AAA: = wdfieldPage;
WordApp.ActiveWindow.activePane.view.seekview: = wdseekCurrentPageHeader;
WordApp.Selection.move (mm, nnn);
WordApp.Selection.PARAGRAPHFORMAT.ALGNMENT: = WDAGIGNPARAGRAPHCenter;
WordApp.Selection.inStafter ('Teil');
mmmm: = wdcharacter;
WordApp.Selection.move (mm, nnn);
WordApp.Selection.Fields.Add (WordApp.Selection.Range, AAA, MMM, NNN);
AAA: = wdfieldnumpages;
WordApp.Selection.insertafter ('Seite/Kapitel');
WordApp.Selection.move (mm, nnn);
WordApp.Selection.Fields.Add (WordApp.Selection.Range, AAA, MMM, NNN);
WordApp.Selection.insertafter ('Seite');
WordApp.ActiveWindow.activePane.view.seekview: = wdseekMaindocument;
Ende;
Sie können jedoch nur die erste Seite ändern.