#1
|
|||
|
|||
TOC combine two styles into one line
I have an aircraft manual called an MEL. Each MEL entry has an ATA number. So it looks like this: 29-24-01 Yellow System Pump. These types of entries are in tables through the manual with the number, i.e. 29-24-01 with one style applied to it, in one column and the title, i.e.Yellow System Pump in the next column, with another style applied to it. I want 29-24-01 Yellow System Pump to appear in the TOC on one line. Any ideas? Thanks in advance. |
#2
|
|||
|
|||
Try using a TC field. It is a lot more work.
TC Fields by Suzanne Barnhill, MVP |
#3
|
|||
|
|||
Thanks. I'm really hoping there's a better way because this manual is huge and, as you say, it would be a lot of work.
|
#4
|
||||
|
||||
It is not possible to combine the contents from different table cells in a single Table of Contents entry. Provided there's a suitable way of identifying both your MEL entries and their corresponding ATA numbers, a macro could be used to create the TC field entries.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#5
|
||||
|
||||
Can you provide a sample doc showing how the content appears?
I'm thinking you might be able to use a styleref field and hide it with a negative indent in the table.
__________________
Andrew Lockton Chrysalis Design, Melbourne Australia |
#6
|
|||
|
|||
MEL example
Thanks for any advice.
|
#7
|
||||
|
||||
Try combining the following macro with a change in your TOC field, from:
"Heading 2,2,Heading 3,3,ATA MEL Item,5" to: "Heading 2,2,Heading 3,3" \f Code:
Sub Demo() Application.ScreenUpdating = False Dim Tbl As Table, r As Long, Rng As Range, StrTC As String For Each Tbl In ActiveDocument.Tables With Tbl If Split(.Cell(1, 1).Range.Text, vbCr)(0) = "ATA - SYSTEM &" Then For r = 5 To .Rows.Count StrTC = "TC " & Chr(34) & Split(.Cell(r, 1).Range.Text, vbCr)(0) Set Rng = .Cell(r, 2).Range With Rng .End = .End - 1 StrTC = StrTC & " " & .Text & Chr(34) & " \l 5" .Collapse wdCollapseEnd .Fields.Add .Duplicate, wdFieldEmpty, StrTC, False End With Next End If End With Next Application.ScreenUpdating = True End Sub
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#8
|
|||
|
|||
When I tried that, and updated the table of contents, it gave me just one entry (30-Ice and Rain Protection), which uses the heading ATA CH Normal. But there is another one using that ATA CH Normal so not sure why that one isn't showing up.
My TOC code looks like this: {TOC \o "1-1" \n 3-4 \h \z \t "Heading 2,2,Heading 3,3" \f} and I added the macro. Not sure what I'm doing wrong, although I am concerned with the set up of the Word document. I didn't create it, just inherited it. |
#9
|
||||
|
||||
Quote:
For PC macro installation & usage instructions, see: http://www.gmayor.com/installing_macro.htm For Mac macro installation & usage instructions, see: https://wordmvp.com/Mac/InstallMacro.html
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#10
|
|||
|
|||
OMG I'm an idiot. Yes, now it works beautifully! You're a star! Thank you so much!
|
Tags |
styles, toc format |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Changing styles without returning to the next line | ketyl | Word | 9 | 07-08-2023 07:35 PM |
Table styles - First column shading with bottom line on page break | NicB | Word Tables | 2 | 02-20-2019 03:05 AM |
Question about spacing between multi-level bullet styles (and other styles) | SDwriter | Word | 0 | 09-26-2017 09:39 AM |
Bullets within Similar Styles - Different Line Height | meden1027 | Word | 5 | 05-06-2013 10:38 AM |
Multiple styles on same line in Microsoft Word | jhopppppp | Word | 2 | 12-05-2008 10:16 AM |