Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 11-09-2020, 11:50 AM
sgrobins sgrobins is offline TOC how do I make page numbers one single font? Mac OS X TOC how do I make page numbers one single font? Office 2016 for Mac
Novice
TOC how do I make page numbers one single font?
 
Join Date: Nov 2020
Posts: 2
sgrobins is on a distinguished road
Default TOC how do I make page numbers one single font?


In my TOC, each level is a different font. Some are plain, others italic. The page numbers match the levels. I'd rather have one single font/style for the numbers. Is there a way to change the formatting of just the page numbers but not the titles?
Attached Images
File Type: png Screen Shot 2020-11-09 at 1.49.00 PM.png (39.5 KB, 12 views)
Reply With Quote
  #2  
Old 11-09-2020, 05:20 PM
Guessed's Avatar
Guessed Guessed is offline TOC how do I make page numbers one single font? Windows 10 TOC how do I make page numbers one single font? Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 3,975
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

There isn't a fancy field code trick to do this but it could be done by applying local font formatting AFTER you refresh the TOC. This would need to be done every time the TOC is updated.

You could either apply this formatting manually or create a macro to do it. A macro that makes all page numbers the same as the first one could look like this.
Code:
Sub TOC_PageNums()
  Dim aPara As Paragraph, aRng As Range, aTOC As TableOfContents
  Set aTOC = ActiveDocument.TablesOfContents(1)
  aTOC.Update
  For Each aPara In aTOC.Range.Paragraphs
    aPara.Range.Words.Last.Previous.Font = aTOC.Range.Paragraphs(1).Range.Words.Last.Font
  Next aPara
End Sub
Does that work on your Mac?
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote
  #3  
Old 11-09-2020, 11:59 PM
sgrobins sgrobins is offline TOC how do I make page numbers one single font? Mac OS X TOC how do I make page numbers one single font? Office 2016 for Mac
Novice
TOC how do I make page numbers one single font?
 
Join Date: Nov 2020
Posts: 2
sgrobins is on a distinguished road
Default

Thank you!
Quote:
Originally Posted by Guessed View Post
There isn't a fancy field code trick to do this but it could be done by applying local font formatting AFTER you refresh the TOC. This would need to be done every time the TOC is updated.

You could either apply this formatting manually or create a macro to do it. A macro that makes all page numbers the same as the first one could look like this.
Code:
Sub TOC_PageNums()
  Dim aPara As Paragraph, aRng As Range, aTOC As TableOfContents
  Set aTOC = ActiveDocument.TablesOfContents(1)
  aTOC.Update
  For Each aPara In aTOC.Range.Paragraphs
    aPara.Range.Words.Last.Previous.Font = aTOC.Range.Paragraphs(1).Range.Words.Last.Font
  Next aPara
End Sub
Does that work on your Mac?
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
TOC how do I make page numbers one single font? change font for all page numbers lemonphenomenon Word 17 12-19-2020 03:20 PM
TOC how do I make page numbers one single font? make single letter top to bottom of page-Large famreeks Word 3 04-27-2017 05:40 PM
Make a certain font face and font color as default in a document. Singh_Edm Word VBA 2 09-13-2014 08:47 PM
How do I make the page numbers appear on the left in TOC? Faizah Noor Word 0 07-08-2013 12:59 AM
TOC how do I make page numbers one single font? Make Font Dropdown Change All Styles' Font trevorhiller Word 1 04-14-2012 02:14 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 12:59 AM.


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