![]() |
#1
|
|||
|
|||
![]()
Hello, Greeting to Everyone
While setting/adjusting the pagenumbers via VBA or pywin (python) the first page header gets expand which distrupts the formatting of every other pages. Here is the code recorded from word Code:
Sub AdjustpageNumbers() With Selection.Sections(1).Headers(1).PageNumbers .NumberStyle = wdPageNumberStyleArabic .HeadingLevelForChapter = 0 .IncludeChapterNumber = False .ChapterPageSeparator = wdSeparatorHyphen .RestartNumberingAtSection = True .StartingNumber = 84 End With End Sub I have attached the snipped images of before and after running the code. Please have a look. first page does not have a page number (header) because the document is set to Different First page = True and Different odd and even page = True The main concern is that I have defined some functions that continue page numbers in multiple documents. But in some cases, the function returns wrong page numbers because whenever the function to set a new page number is called or if the header is accessed through the code, an extra paragraph is appears in the first page of the document which causes all the following pages to overflow. Hence, returning the false page number (in most cases total page + 1). I wanted to know if this could be avoided. Or if i am doing anything wrong. |
Tags |
setting page numbers |
Thread Tools | |
Display Modes | |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Even page numbers disappear when setting up opposite headers. | slromine | Word | 2 | 08-02-2019 08:05 AM |
![]() |
thefonebug | Word | 12 | 10-24-2016 05:18 AM |
How do I edit my TOC to reference the section numbers instead of the page numbers??? | mikey386 | Word | 0 | 12-17-2014 02:34 PM |
How do I refer to page numbers, when the numbers change as I prepare the document? | StevenD | Word | 5 | 11-29-2012 12:52 AM |
![]() |
gracie5290 | Word | 1 | 02-02-2012 11:41 PM |