If chkExecSummary.Checked = True Then SectionNumber = 3 Else SectionNumber = 2 ' Determines if there are two or three sections in word doc.ĭim FooterSectionsRange As Wordx.Range = wdDoc.Sections(SectionNumber).Footers().Rangeĭim FooterSectionsSelection As Wordx.Selection = wdDoc.Sections(SectionNumber).Footers().Rangeį(FooterSectionsRange,, " Page ", False)į = .WdParagraphAlignment.wdAlignParagraphRightį = "CG Omega"į = .WdColor.wdColorBlack NumberStyle = .WdPageNumberStyle.wdPageNumberStyleLowercaseRomanį = Not WdDoc.Sections(SectionNumber).PageSetup.DifferentFirstPageHeaderFooter = Trueį(FooterExecSummaryRange,, " Page ", False)į = .WdParagraphAlignment.wdAlignParagraphRightį = "CG Omega"į = .WdColor.wdColorBlack If chkExecSummary.Checked = True Then ' If this checkbox is checked, then the second section should have page numbering as LowercaseRomanĭim FooterExecSummaryRange As Wordx.Range = wdDoc.Sections(SectionNumber).Footers().Rangeĭim FooterExecSummarySelection As Wordx.Selection = wdDoc.Sections(SectionNumber).Footers().Range Add Page Numbers to any sections after section #1
#INSERTING PAGE NUMBERING IN WORD 2016 CODE#
Then when I attempt to insert page numbers in the document footer by each section, the code ignores sections and sets it for the entire document. I have code creating Word documents with two or three sections depending upon one check box that is selected by the user. and so on.I am having difficulty managing page numbers between sections. I routinely assign Heading 8 to Appendix A.1, A.2. I routinely assign Heading 7 to Appendix A, Appendix B. In "Use separator," make sure "hyphen" is selected. In "Chapter starts with style," select Heading 8.Ĭ. Make sure the checkbox Include Chapter Number is selected.ī. In your Word ribbon, select Header/Footer > Page Number > Format Page Number > Page Number Format:Ī. Just before you start a new Level 2 package, create a logical section break.ĥ. Assign Heading 8 to autonumber your Level 2 work packages (0001.1, 0001.2. Assign Heading 7 to autonumber your Level 1 work packages (0001, 0002. Paul Vroegindewey, you can even use the approach to automatically number pages 0001.1-1, 0001.1-2, etc. A video by Wolf Helping Hand shows how at Microsoft explains how in "Example 2: Inserting Page Numbers for Chapters and Appendixes" at Ģ.
#INSERTING PAGE NUMBERING IN WORD 2016 HOW TO#
Several sites have explained how to create prefixed page numbers that will fully autonumber in one's Table of Contents, List of Figures, and List of Tables.ġ.
In the Format list, choose the option for capital letters (A B C.).Choose Section in the Field Names list.Make sure the Numbering category is selected in the Categories list.Click the Quick Parts tool (in the Text group) and then choose Field.
Format your header or footer as desired.Click Current Position | Plain Number.Word displays some options for your page number. Click the Page Number tool in the Header & Footer group.If you are using a newer version of Word, go to step 5. In older versions of Word, make sure the Design tab of the ribbon is displayed.Type the section letter followed by a dash.(If you want the page number in the header, simply follow this step but look for "Header" instead of "Footer" in each instance.) Word displays the footer area of the current page and places the insertion point there. Assuming you want the page number in the footer, click the Footer tool in the Header & Footer group and then click Edit Footer.For instance, if each "section" is actually a different document file, then you simply need to set your page numbers this way: Exactly how you do this depends on how you have your documents set up. For instance, you may want them numbered as A-1, A-2, A-3, etc. In many documents you may have a need to number your pages with a section number as a preface.