How to Insert Parentheses Around TOC Pages

I have a Word 2010 table of contents that has the page references immediately following the headings (no dot leaders). I would like to put parentheses around the page numbers (or insert commas) to separate them from the headings. When I toggle the page number in my table of contents, it shows the following: {PAGEREF _Toc366490238 \h}. I opened the field PAGEREF and added the following: PAGEREF  \# "( )" The TOC balks right away and says "Error! no bookmark name given." When I return to the the PAGEREF, my switch is gone. I looked at the following article on Word fields, but I'm still stumped: http://www.gmayor.com/formatting_word_fields.htm. I would insert a sample of what I'm trying to create, but this web editor doesn't seem to respect my carriage returns (hence the gigantic paragraph above).
Can you provide more details on how you are trying to do so?
Upload a  sample file maybe.
Trying to be helpful.

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

I am not familiar with the "()" picture switch.

Do you mean that you are using:
{PAGEREF _Toc366490238 \h \# "( )"}

I think you would want:
{PAGEREF _Toc366490238 \h \# "(#)"}

Note that Tables of Contents using the TOC field are much easier to construct and maintain. However, I'm not sure they can do what you want.

How to create a table of contents in Microsoft Word
Volunteering to "pay forward" the help I've received in the Microsoft user community.


Charles Kenyon
Sun Prairie, Wisconsin
wordfaq[at]addbalance[dot]com

Legal site: https://addbalance.com

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

I'm afraid you can't customize the PAGEREF fields added by the table of contents. Any customizations will be lost the next time you update the TOC.

Stefan Blom
Microsoft 365 Word MVP since 2005
Volunteer Moderator (Office)
MS 365, Win 11 Pro
~~~~
Please note that I do not work for Microsoft
MVP program info: https://mvp.microsoft.com/
~~~~

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

I agree with Stefan that you will have to re-do this each time you update your TOC.

Not fun.

I expect it could be done with wildcard replace but that is more than I am able to do.
Volunteering to "pay forward" the help I've received in the Microsoft user community.


Charles Kenyon
Sun Prairie, Wisconsin
wordfaq[at]addbalance[dot]com

Legal site: https://addbalance.com

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

To add comma as the separator between an entry and its page number, you can add the \p "," switch to the TOC field code and then update the TOC.

Stefan Blom
Microsoft 365 Word MVP since 2005
Volunteer Moderator (Office)
MS 365, Win 11 Pro
~~~~
Please note that I do not work for Microsoft
MVP program info: https://mvp.microsoft.com/
~~~~

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

Yes, I'm looking for an option that will persist after I update the TOC.

Is that comma separator option supposed to persist after a TOC update? When I tried that, it seemed to disappear after I would update the TOC.

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

Yes, edits that you make to the field code will persist (for the particular field that you changed). Press Alt+F9 to display field codes. Add \p "," to the TOC field code. Press F9 to update (be sure that you choose to update the whole table). Press Alt+F9 again to hide field codes.
Stefan Blom
Microsoft 365 Word MVP since 2005
Volunteer Moderator (Office)
MS 365, Win 11 Pro
~~~~
Please note that I do not work for Microsoft
MVP program info: https://mvp.microsoft.com/
~~~~

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

 
 

Question Info


Last updated January 8, 2024 Views 1,238 Applies to: