Solved

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

Posted on 2014-03-14
14
634 Views
Last Modified: 2014-03-15
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.

PLEASE HELP!!

Thanks,
EEH
Modifying-TOC.doc
0
Comment
Question by:ExpExchHelp
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 4
  • 3
  • +2
14 Comments
 
LVL 35

Expert Comment

by:Dan Craciun
ID: 39929149
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.

HTH,
Dan
0
 

Author Comment

by:ExpExchHelp
ID: 39929158
Dan:

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.  ;)

EEH
0
 
LVL 35

Expert Comment

by:Dan Craciun
ID: 39930083
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: http://news.office-watch.com/t/n.aspx?articleid=165&paginate=false

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?

HTH,
Dan
Modifying-TOC-v2.doc
0
Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

 

Author Comment

by:ExpExchHelp
ID: 39930208
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?

Thx,
EEH
0
 
LVL 35

Expert Comment

by:Dan Craciun
ID: 39930216
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.
0
 
LVL 76

Expert Comment

by:GrahamSkan
ID: 39930409
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.
0
 
LVL 32

Accepted Solution

by:
Paul Sauvé earned 500 total points
ID: 39930887
Hi - if this is the result you are looking for, I will ecplain how to accomplish it (THREE steps)...

PaulS
Modifying-TOC.doc
0
 
LVL 32

Assisted Solution

by:Paul Sauvé
Paul Sauvé earned 500 total points
ID: 39930894
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
0
 
LVL 76

Expert Comment

by:GrahamSkan
ID: 39931445
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"
                rng.Select
                Selection.InsertStyleSeparator
                point = rng.End
            End If
         End If
    Next para
End Sub

Open in new window

0
 
LVL 21

Expert Comment

by:Eric Fletcher
ID: 39931626
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.
0
 
LVL 35

Expert Comment

by:Dan Craciun
ID: 39931651
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¢
Dan
0
 
LVL 32

Expert Comment

by:Paul Sauvé
ID: 39931727
There are always workarounds to get the results you want in Word. But they're always a pain in the thigh or thereabouts!
0
 

Author Closing Comment

by:ExpExchHelp
ID: 39931769
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.
0
 
LVL 32

Expert Comment

by:Paul Sauvé
ID: 39931964
Thank you. Glad to be of assistance
Paul Sauve
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Outlook Free & Paid Tools
This article describes how you can use Custom Document Properties to store settings and other information in your workbook so that they will be available the next time you open the workbook.
This Experts Exchange video Micro Tutorial shows how to tell Microsoft Office that a word is NOT spelled correctly. Microsoft Office has a built-in, main dictionary that is shared by Office apps, including Excel, Outlook, PowerPoint, and Word. When …
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

688 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question