PDA

View Full Version : [SOLVED:] Search and replace in TOC



kathyb0527
07-12-2016, 03:10 PM
In my documents I have multiple Appendices (the number of Appendices changes). Each Appendices has a page titled "Appendix "A"" followed by a soft return then "Blah Blah BLah". both are tagged as Heading 8. When I create a TOC, it looks like this:

Appendix A Blah blah blah.......................32
Appendix B More blah blah .....................42

I would like there to be separation between Appendix A and Blah blah blah so that it looks like this without having to manually enter the tab:

Appendix A Blah blah blah...................32
Appendix B More blah blah .................42

Basically, I need to insert a tab between the two, however, I am not sure if I need to correct the Heading style or the TOC style OR if I need some code to insert a tab. I am not familiar with writing code for Word, but there is already code to break the TOC up and add "Table of Contents, continued" to each page that I did not write. Don't know if that helps. And I am using Word 2010.

Thank you

jec1
07-15-2016, 07:46 PM
Hi

This is not search and replace macro but typing a TC field and using a different TOC level with a different tab setting.

{TOC \t "Heading 1,1,Heading 2,2" \f \h } exclude Heading 8 for Appendices.

After you insert Heading Appendice heading insert TC field copy (use Building Blocks to insert a preformatted TC field):

{ TC "Appendix 1 [Insert Ctrl Tab] Heading for Appendix 1" \l4} - I used l4 for TOC - this allows you to set a wider tab and no need for a macro.

Yes the space is a Ctrl Tab between Appendix 1 Ctrl Tab Appendix 1 Heading in the TC field.

Just an idea.

Jen

Paul_Hossler
07-16-2016, 06:06 PM
I made "Appendix" part of the Numbering for Header8, which gives you a tab

Inserting a TOC at the top and redefining Header8 a little gets this

16632

jec1
07-16-2016, 07:37 PM
Hi Paul, only issue is main heading not centered correctly which is why I suggested TC field.

Paul_Hossler
07-17-2016, 06:18 AM
OP said ...



I would like there to be separation between Appendix A and Blah blah blah so that it looks like this without having to manually enter the tab:



1. The before and after look the same to me

2. What main heading?

3. The TC field seems to repeat APPENDIX in the TOC

4. BTW -- I should have said "Inserting a TOC at the top and redefining TOC8 a little gets this"

jec1
07-17-2016, 03:42 PM
1. Your style has a 0.25 I think tab. That means heading is not centered between margins. That is the main heading.
3. TC field can contain any text you like that was just blah blah blah text.
4. I know how you get it - but you don't work in legal and document formats need to be precise. Centered headings in documents being one of them.

It is not my call. Just suggestions.

Jen

kathyb0527
07-18-2016, 11:59 AM
Hi All, thank you for the suggestions. Jen is correct and the centered heading is important in the document. I will put in a second TOC to address this issue with the Appendices. It is much simpler than the direction I was going. THank you again.

Paul_Hossler
07-18-2016, 12:23 PM
1. Yea, Jen :thumb

2. I don't see any requirement in the thread about centered headings, and the example in #1 doesn't seem to show anything centered. To make me a tiny bit smarter, what is the main heading that is supposed to be centered?

kathyb0527
07-19-2016, 09:34 AM
Hi Paul, my initial thread does not indicate that Heading 8 needs to be centered. Jen correctly inferred that I would not need to put in a soft return and could add in a tab if it was left justified because it would not throw off the alignment. In your document, Appendix A is not correctly center aligned on the page because you put the tab in, shifting the words to the left. Seems very picky, but for companies that use document systems (databases) even one space off can cause an issue loading or retrieving the document. Hope that helps.