Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 06-13-2018, 10:15 AM
d4okeefe d4okeefe is offline Problems with Page X of Y numbers Windows 10 Problems with Page X of Y numbers Office 2016
Advanced Beginner
 
Join Date: Apr 2013
Posts: 77
d4okeefe is on a distinguished road
Default

I think that the "X" and "Y" in "Page X of Y" are fields. You can see fields in the document by typing Alt-F9. (Type Alt-F9 again to hide them.)

You can delete fields in the headers with a for loop.

Code:
Sub delete_fields_in_header()
    Dim x As Integer, num_fields As Integer
    num_fields = ActiveDocument.Sections(1).Headers(wdHeaderFooterPrimary).Range.Fields.Count
    
    For x = num_fields To 1 Step -1
        ActiveDocument.Sections(1).Headers(wdHeaderFooterPrimary).Range.Fields(x).Delete
    Next x
End Sub
Reply With Quote
 

Tags
page x of y



Similar Threads
Thread Thread Starter Forum Replies Last Post
Problems with Page X of Y numbers Footer for page numbers recently started showing a colored field when adding page numbers 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
Problems with Page X of Y numbers Parallel page numbering/same page numbers for odd and even pages goran Word 2 11-02-2012 03:42 PM
Problems with Page X of Y numbers Page Numbers Not Matching Chapter Numbers gracie5290 Word 1 02-02-2012 11:41 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 01:17 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft