databaseferro.blogg.se

How to do headers and footers in microsoft word
How to do headers and footers in microsoft word








how to do headers and footers in microsoft word how to do headers and footers in microsoft word
  1. #HOW TO DO HEADERS AND FOOTERS IN MICROSOFT WORD HOW TO#
  2. #HOW TO DO HEADERS AND FOOTERS IN MICROSOFT WORD CODE#

#HOW TO DO HEADERS AND FOOTERS IN MICROSOFT WORD HOW TO#

In this tutorial, I will show you how to add headers and footers in Microsoft Word. In Microsoft Word, you can add title, page numbers, dates, or some graphics to every page in a document using headers and footers.

#HOW TO DO HEADERS AND FOOTERS IN MICROSOFT WORD CODE#

This code example uses the active document. Headers and footers are areas in the top or bottom of each page in a document. The following code example adds a field to show the page number in each header in the document, and then sets the paragraph alignment so that the text aligns to the right of the header. For Each section As Word.Section In Me.įoreach (Word.Section wordSection in ) This code example uses the active document. The following code example sets the font of the text to be inserted into the primary footer of each section of the document, and then inserts text into the footer. To use the following code examples, run them from the ThisAddIn class in your project. = įoreach (Word.Section section in this.Sections) For Each section As Word.Section In Me.Sectionsĭim headerRange As Word.Range = section.Headers().Range For Each section As Word.Section In Me.Sectionsĭim footerRange As Word.Range = section.Footers().Rangeį = įoreach (Word.Section wordSection in this.Sections) The following code example sets the font of the text to be inserted into the primary footer of each section of the document, and then inserts text into the footer. How to accommodate different headers and footers in a Word document To change a documents header or footer in a Microsoft Word document, you should add a section break first. To use the following code examples, run them from the ThisDocument class in your project. For more information, see Features available by Office application and project type. The procedures are different for document-level customizations and VSTO Add-ins.Īpplies to: The information in this topic applies to document-level projects and VSTO Add-in projects for Word. Each section of a document contains three headers and footers: You can add text to headers and footers in your document by using the Headers property and Footers property of the Section.










How to do headers and footers in microsoft word