Hi Eric
Eric said:
Hi, anyone can tell me the VBA command to create document Header and Footer?
I also want to add page number on page-footer but only print from page 2.
And print total page count on the first line of each page, including on
page 1.
The DifferentFirstPageHeaderFooter property defines whether you have a
separate header/footer just for page 1
If DifferentFirstPageHeaderFooter is True, then when you insert test into
ActiveDocument.Sections(1).Footers(wdHeaderFooterPrimary), then it only
appears on pages 2 & onwards
To insert page numbers that update, you need to insert a PAGE field. Take a
look at the Add method of the Fields collection.
To insert a page total that updates, you need to insert a NUMPAGES field.
To insert text into the page header, you need to reference
ActiveDocument.Sections(1).Headers(wdHeaderFooterPrimary) for page 2 &
onwards and ActiveDocument.Sections(1).Headers(wdHeaderFooterFirstPage) for
the first page.