
11-09-2020, 11:59 PM
|
Novice
|
|
Join Date: Nov 2020
Posts: 2
|
|
Thank you!
Quote:
Originally Posted by Guessed
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?
|
|