

Get list items created in current month.Position your cursor where you’d like to add the page number. This opens the Design tab under Header & Footer Tools. Double-click the header or the footer area (near the top or bottom of the page).

#Word footer page x of y code#
Use the Page field code to add page numbers to a header or footer.

Simple as this you can accomplish what is requested. Range footer = įooter.Collapse(WdCollapseDirection.wdCollapseStart) į(footer, WdFieldType.wdFieldNumPages) į(footer, WdFieldType.wdFieldPage) įeel to extend it and use this code. We just need to make a slight change with this line: .SeekView If you have any concern for this, please feel free to follow up. Now looking back, code seems to be easy, but believe me, wasn’t easy at all to put pieces side by side to obtain this effect because there is lack of documentation about Word add-ins projects.įoreach(Section section in .Sections) The code sample focuses on the footer of document. It seems to be a special need for this, because sometimes people are requested to scan documents and miss some pages.
#Word footer page x of y how to#
I have spent hours to figure out how to do this. The entry will now appear in the Insert > Footer gallery, and you can insert it with a click. Enter a name, set the Gallery dropdown to 'Footers' and click OK. Adding “Page X of Y” pagination type into a Word document from C# into a Word add-in project can be very difficult. The next best way is to create the whole footer in any document, select the entire line, and press Alt+F3 to open a dialog for saving it as an AutoText entry.
