![]() |
|
#1
|
|||
|
|||
|
Hi all,
this is my first post and I apologize in advance for errors. I am an Italian researcher in law and political sciences, and I use word (word for mac 2011) to write my scientific articles for Italian scientific journals. For several scientific journals in law, I need to write a "compact" Table of Content of my article after title and abstract, with all entries in one paragraph, without starting a new line after each header and page. If I use ms word TOC (both with styles or TC fields), I get: Table of contents Introduction....1 Paragraph1...3 Paragraph2...5 Conclusion...8 I would need: Table of contents: Introduction, 1 - Paragraph1, 3 - Paragraph2, 5 - Conclusion, 8. How I may customise TOC to avoid to start a new line after page number? Actually, I have to write the TOC manually and create crossref for each paragraph headers, to update page numbers. I would like to use TOC field with styles or TC fields. Thank you in advance, Luigi |
|
#2
|
|||
|
|||
|
A TOC cannot appear the way you want. It is one line per entry.
Look into the Index feature. |
|
#3
|
||||
|
||||
|
Charles is right but you can retrofit a table of contents after refreshing it to do basically what you are asking. The following macro could be used to refresh your TOC and then compact it.
Code:
Sub CompactTOCUpdater()
Dim aRng As Range, aTOC As TableOfContents
Set aTOC = ActiveDocument.TablesOfContents(1)
Set aRng = aTOC.Range
aTOC.Update
With aRng.Find
.ClearFormatting
.Replacement.ClearFormatting
.Text = "^t"
.Replacement.Text = ", "
.Forward = True
.Wrap = wdFindStop
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
.Execute Replace:=wdReplaceAll
.Text = "^p"
.Replacement.Text = " – "
.Execute Replace:=wdReplaceAll
End With
End Sub
__________________
Andrew Lockton Chrysalis Design, Melbourne Australia |
|
#4
|
|||
|
|||
|
Dear all,
I thank you very much for your answers. I will try the macro. Greetings, Luigi |
|
| Tags |
| table of contents |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Why does paragraph inherit style of the following paragraph? | WADEVCAMP | Word VBA | 2 | 04-08-2019 02:13 PM |
Continuous Paragraph across two columns vs Parallel Column Paragraph
|
Pinesh | Word | 2 | 03-09-2018 04:24 PM |
Cross-reference to paragraph not updating when paragraph moves
|
windhoek2010 | Word | 1 | 09-15-2017 08:30 PM |
alphabetize a list (manual index) with entries and sub-entries
|
shmu | Word | 5 | 08-01-2016 11:15 PM |
Narrow Paragraph to Wide Paragraph HELP
|
icloudy | Word | 1 | 12-09-2012 03:49 PM |