PDA

View Full Version : Selection.Fields.Update for TOC



JimVBrook
02-09-2015, 10:09 PM
I need a macro which will update a TOC with the "Update entire table" instead of just the "Update page numbers only" option. Recording a macro for either option just provides Selection.Fields.Update.
Maybe there isn't a solution but I would be very please if there was. Thank you. :)

gmayor
02-09-2015, 11:18 PM
The following will do that



Sub UpdateAllTOC()
Dim oTOC As TableOfContents
For Each oTOC In ActiveDocument.TablesOfContents
oTOC.Update
Next oTOC
lbl_Exit:
Exit Sub
End Sub

JimVBrook
02-10-2015, 01:17 AM
:):)



The following will do that



Sub UpdateAllTOC()
Dim oTOC As TableOfContents
For Each oTOC In ActiveDocument.TablesOfContents
oTOC.Update
Next oTOC
lbl_Exit:
Exit Sub
End Sub