MS-Word -- need help with modifying Table of Content (TOC)

Hello Experts:

Please see attached Word document which contains 3 TOCs.   I need assistance with modifying the "Table TOC" and "Figure TOC".

Essentially, right now all table and figure references (in the chapters) will -- and have to -- display the following:

Table 1.  Structure ABC
Figure 1.  Koala in Australia Zoo

[Note: above are just test examples).

However, given that the actual document will contain hundreds of tables, I was advised that the words "Table" -- and "Figure" should not be listed in the TOCs.

The attached document provides examples what they should look like (please see page 2 and page 3).  

My question:  How do I modify the Table TOC and Figure TOC in order to remove the words "Table" + leading space before table #?   Same applies for the Figure TOC.

Note:  I don't not want to manually remove these words from hundreds of table references and then choose "update page # only".    Instead, when updating the entire table/TOC, I automatically want to display their reference numbers only.


Who is Participating?
Paul SauvéConnect With a Mentor RetiredCommented:
Hi - if this is the result you are looking for, I will ecplain how to accomplish it (THREE steps)...

Dan CraciunIT ConsultantCommented:
Make the "Table " and "Figure " a differently named style than the "2. Western map".
Then you will be able to set the TOC style to the style of the text.

(Not related) If you want to do hundreds of pages with tables and images, please don't use Word. Try a desktop publishing software that is made specifically for this: Indesign, Quark, Scribus, Publisher if you don't have other choices.
You will save a lot of time and get a better looking output.

ExpExchHelpAuthor Commented:

Thank you for the prompt response.    Could you please provide me more details how to change the TOC style?   Alternatively, any chance you provide me the example document.

Note:  I'm not forced to use Word, so unfortunately I don't have the flexibility to use a desktop publishing document as you suggested.   Good point though.  ;)

Cloud Class® Course: Microsoft Windows 7 Basic

This introductory course to Windows 7 environment will teach you about working with the Windows operating system. You will learn about basic functions including start menu; the desktop; managing files, folders, and libraries.

Dan CraciunIT ConsultantCommented:
I tried with the different styles, it does not work. The TOC does not use StyleRef fields, simply collects the entire line.

That being said, if you insert the table and image captions using References->Insert Caption, you can use the /a switch to remove the "Figure 1" or "Table 1" part.
See here for the TOC parameters:

I've attached the modified file. It does not have numbering on the tables/figures names, but I guess you can apply a style with numbering on them to get them to look like you want.

PS1: if you want to see the field code in a Word document, press ALT+F9
PS2: if you're not forced to use Word, then why do you?

ExpExchHelpAuthor Commented:
Thanks, Dan.

I looked a the ToT and ToF.   Both of them missing the numbers though.  

What I needed is to remove the word, e.g., Table + leading space before the number.  

How can it be modified to include them again?

Dan CraciunIT ConsultantCommented:
You add them using Numbering (I mean select the ToT, press Numbering on the ribbon, between Bullets and Multilevel List)

You'll probably need to add tabs as the formatting will change.
I think that the 'Style Separator' option should be usable here. This is the possibility to change the paragraph style mid paragraph, so that, as I understand it, the embedded paragraph style can be used to create the TOC.

However, the usage is less that intuitive, so I am hoping that our man-of-style, Eric Fletcher will notice and give us the benefit of his experience.
Paul SauvéConnect With a Mentor RetiredCommented:
Insert the ToF and ToT with Include label and number UNCHECKED.ToF Select one line in one of the tables and click on Numbering

Open the Styles pane (Alt+Ctrl+shift+s), find the TABLE OF FIGURES style to Update Table of figure to match selection

In the second table, restart the numbering at 1
OK. I have now been able to get my head around Style Separators.

Style separators enable different paragraph styles to be applied to text within the same paragraph.They were introduced in Word 2002.  They are useful here because Tables of Contents and Tables of Figures can be created based on a style. The Insert Style Separator button does not appear in the menus by default, so a QAT or command bar button (depending on the Word release) must be added if you need to insert a style separator manually.

In use, the command changes the final paragraph mark of the selected paragraph into a Style Separator. This functionality makes it a bit difficult to selectively change the style of particular text  in a heading or a caption that has already been typed.

In the document you have supplied, the 'Figure' paragraph style that is used for the sample caption. Also in the document, you also have a 'Figure Caption' paragraph style that looks the same. The macro below applies the 'Figure Caption' style to the  text that you say that you want to appear in the table. After it has been run, the Table of Figures can then be created using the 'Figure Caption' style.
Sub ChangeParaStyle()
    Dim para As Paragraph
    Dim rng As Range
    Dim rng2 As Range
    Dim point As Long
    For Each para In ActiveDocument.Paragraphs
        If para.Style = "Figure" Then
            Set rng = para.Range
            If rng.start > point Then    'Code disturbs For Each current paragraph,
                                         'so make sure that we don't work on the same paragraph twice.
                Set rng2 = rng.Duplicate    'Inserting style separator
                rng2.Collapse wdCollapseEnd 'merges paragraphs,
                rng2.Text = vbCr & vbCr     'so add two more.
                rng.Select                     'Range has no InsertStyleSeparator method - 
                Selection.InsertStyleSeparator 'it only works on the Selection.
                rng.MoveStart wdCharacter, Len("Figure ") 'Trim the
                rng.MoveEnd wdCharacter, -1               'range
                rng.Cut                 'Move the text to
                rng.Move wdCharacter, 1 'the other side of
                rng.Paste               'the StyleSeparator
                rng.Style = "Figure Caption"
                point = rng.End
            End If
         End If
    Next para
End Sub

Open in new window

Eric FletcherCommented:
You can't do this automatically with the TOC field code. As you probably discovered, the Insert Caption dialog assists in entering the SEQ field and provides an option to include or exclude the "Figure" or "Table" identifier. Unfortunately, it puts it in as text, so it will be included in the TOC.

I don't not want to manually remove these words from hundreds of table references and then choose "update page # only".
You wouldn't need to do that manually. Choose your Table of Figures after it has been updated and open the Find & Replace dialog. In the Find what box, type "Table " (no quotes, but include the trailing space), then use More > Format > Styles and choose the Table of Figures style. Leave the Replace with box empty and click Replace All. This will remove all of the "Table " instances at once from the generated ToC, but won't affect any instances within the document  because they are within "Table" styled ¶s in your example.

Do remember that you'll need to repeat this if you rebuild the ToC — although the "Table " parts won't reappear if you simply update the numbering.

And as an aside re Dan Craciun's comment... While I would agree about using a page layout product for getting very fine design control, Word is quite capable of producing a very large document with tables and figures. I have several examples with >600 pages and several hundred complex tables, figures and many images. Word will certainly choke if you not used properly, but that is also true for products like InDesign.
Dan CraciunIT ConsultantCommented:
I've seen examples of huge documents made in Word too. And I still pity their authors...

As someone who did print layout for a living in the early 2000s, I was forced to use Word for dictionaries, cause nested styles in Indesign weren't available yet and I was better with VBA than with JS.
Learned a lot about Word, did the job, hated it. Layout in Word is clumsy, the output lacks fine control for print, the time required to position elements in a page is huge compared with Indesign/Quark. Don't get me started on proxy images :)

My point: Word is very good for business documents, where you simply need to present text and some tables/images. Don't try to make it do everything. And definitely don't use it for jobs that require offset printing.

My 2¢
Paul SauvéRetiredCommented:
There are always workarounds to get the results you want in Word. But they're always a pain in the thigh or thereabouts!
ExpExchHelpAuthor Commented:
Everyone... thank you for your feedback.   I truly appreciate it.

In the end, I will have to award the points to Paul for a most excellent solution.  

Again, I thank everyone for their contributions as part of this question.
Paul SauvéRetiredCommented:
Thank you. Glad to be of assistance
Paul Sauve
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.