Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 05-02-2019, 08:11 PM
TAJ TAJ is offline TOC combine two styles into one line Windows 10 TOC combine two styles into one line Office 2013
Novice
TOC combine two styles into one line
 
Join Date: May 2019
Posts: 8
TAJ is on a distinguished road
Default 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.
Reply With Quote
  #2  
Old 05-03-2019, 05:55 AM
Charles Kenyon Charles Kenyon is offline TOC combine two styles into one line Windows 10 TOC combine two styles into one line Office 2016
Moderator
 
Join Date: Mar 2012
Location: Sun Prairie, Wisconsin
Posts: 9,125
Charles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant future
Default

Try using a TC field. It is a lot more work.
TC Fields by Suzanne Barnhill, MVP
Reply With Quote
  #3  
Old 05-03-2019, 08:09 PM
TAJ TAJ is offline TOC combine two styles into one line Windows 10 TOC combine two styles into one line Office 2013
Novice
TOC combine two styles into one line
 
Join Date: May 2019
Posts: 8
TAJ is on a distinguished road
Default

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.
Reply With Quote
  #4  
Old 05-03-2019, 10:37 PM
macropod's Avatar
macropod macropod is offline TOC combine two styles into one line Windows 7 64bit TOC combine two styles into one line Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,962
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

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]
Reply With Quote
  #5  
Old 05-03-2019, 11:55 PM
Guessed's Avatar
Guessed Guessed is offline TOC combine two styles into one line Windows 10 TOC combine two styles into one line Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 3,969
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

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
Reply With Quote
  #6  
Old 05-04-2019, 06:53 AM
TAJ TAJ is offline TOC combine two styles into one line Windows 10 TOC combine two styles into one line Office 2013
Novice
TOC combine two styles into one line
 
Join Date: May 2019
Posts: 8
TAJ is on a distinguished road
Default MEL example

Thanks for any advice.
Attached Files
File Type: docx MEL Table of Contents Experiment.docx (36.7 KB, 13 views)
Reply With Quote
  #7  
Old 05-04-2019, 12:53 PM
macropod's Avatar
macropod macropod is offline TOC combine two styles into one line Windows 7 64bit TOC combine two styles into one line Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,962
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

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]
Reply With Quote
  #8  
Old 05-04-2019, 04:29 PM
TAJ TAJ is offline TOC combine two styles into one line Windows 10 TOC combine two styles into one line Office 2013
Novice
TOC combine two styles into one line
 
Join Date: May 2019
Posts: 8
TAJ is on a distinguished road
Default

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.
Reply With Quote
  #9  
Old 05-04-2019, 10:57 PM
macropod's Avatar
macropod macropod is offline TOC combine two styles into one line Windows 7 64bit TOC combine two styles into one line Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,962
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Quote:
Originally Posted by TAJ View Post
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.
Did you actually install & run the macro?

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]
Reply With Quote
  #10  
Old 05-04-2019, 11:22 PM
TAJ TAJ is offline TOC combine two styles into one line Windows 10 TOC combine two styles into one line Office 2013
Novice
TOC combine two styles into one line
 
Join Date: May 2019
Posts: 8
TAJ is on a distinguished road
Default

OMG I'm an idiot. Yes, now it works beautifully! You're a star! Thank you so much!
Reply With Quote
Reply

Tags
styles, toc format



Similar Threads
Thread Thread Starter Forum Replies Last Post
TOC combine two styles into one line Changing styles without returning to the next line ketyl Word 9 07-08-2023 07:35 PM
TOC combine two styles into one line 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
TOC combine two styles into one line Bullets within Similar Styles - Different Line Height meden1027 Word 5 05-06-2013 10:38 AM
TOC combine two styles into one line Multiple styles on same line in Microsoft Word jhopppppp Word 2 12-05-2008 10:16 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 04:12 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft