Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 03-25-2020, 11:15 PM
gavi12 gavi12 is offline Converting a Table of Contents into a premade table?? Windows 10 Converting a Table of Contents into a premade table?? Office 2016
Novice
Converting a Table of Contents into a premade table??
 
Join Date: Mar 2020
Posts: 4
gavi12 is on a distinguished road
Default Converting a Table of Contents into a premade table??

Hi



I was wondering if it's possible to convert a table of contents into a pre-made table which can be edited and updated as changes are made.

I have included screenshots of both things which hopefully will help. I have looked at the Create outline function which does put it in a new document but would like the table to be attached to the bottom of the document.

Any help would be greatly appreciated.

Gavin
Attached Images
File Type: jpg TofCcapture.JPG (41.3 KB, 15 views)
File Type: jpg TableCapture.JPG (58.6 KB, 15 views)
Reply With Quote
  #2  
Old 03-25-2020, 11:46 PM
macropod's Avatar
macropod macropod is offline Converting a Table of Contents into a premade table?? Windows 7 64bit Converting a Table of Contents into a premade table?? Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 20,038
macropod has much to be proud ofmacropod has much to be proud ofmacropod has much to be proud ofmacropod has much to be proud ofmacropod has much to be proud ofmacropod has much to be proud ofmacropod has much to be proud ofmacropod has much to be proud ofmacropod has much to be proud ofmacropod has much to be proud of
Default

In a word, no. You could, of course, use cross-references in Columns 1 & 2 to pick up the relevant heading numbers and texts.

That said, I have created macros in the past to turn a Table of Contents into a table. Doing so, however, won't result in a table that updates as you add/delete headings. See, for example: Generate an Index or TOC as a table - Microsoft Community. Doing that and preserving the rest of your table's structure and (presumably) content, is another whole load of complexity.
__________________
Cheers,
Paul Edstein
[MS MVP - Word]
Reply With Quote
  #3  
Old 03-26-2020, 12:26 AM
gavi12 gavi12 is offline Converting a Table of Contents into a premade table?? Windows 10 Converting a Table of Contents into a premade table?? Office 2016
Novice
Converting a Table of Contents into a premade table??
 
Join Date: Mar 2020
Posts: 4
gavi12 is on a distinguished road
Default

Ah ok and thanks for your reply. I have had a look at the code have sent and that makes sense for the most part. Is there a way I can add the extra columns to the table with the years, even if it won't automatically update. That was more a wish list to be honest..
Reply With Quote
  #4  
Old 03-26-2020, 12:33 AM
macropod's Avatar
macropod macropod is offline Converting a Table of Contents into a premade table?? Windows 7 64bit Converting a Table of Contents into a premade table?? Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 20,038
macropod has much to be proud ofmacropod has much to be proud ofmacropod has much to be proud ofmacropod has much to be proud ofmacropod has much to be proud ofmacropod has much to be proud ofmacropod has much to be proud ofmacropod has much to be proud ofmacropod has much to be proud ofmacropod has much to be proud of
Default

You can specify up to 63 columns by changing:
Set Tbl = .Tables.Add(Range:=Rng, NumRows:=i - 2, NumColumns:=3)
__________________
Cheers,
Paul Edstein
[MS MVP - Word]
Reply With Quote
  #5  
Old 03-26-2020, 01:00 AM
gavi12 gavi12 is offline Converting a Table of Contents into a premade table?? Windows 10 Converting a Table of Contents into a premade table?? Office 2016
Novice
Converting a Table of Contents into a premade table??
 
Join Date: Mar 2020
Posts: 4
gavi12 is on a distinguished road
Default heading and numbering issues??

I have managed to work out to add the columns now but it is adding extra numbers. Is there a way I can take that out..

thanks for all your help so far..
Attached Images
File Type: jpg tableupdatecapture.JPG (35.0 KB, 15 views)
Reply With Quote
  #6  
Old 03-26-2020, 04:10 AM
macropod's Avatar
macropod macropod is offline Converting a Table of Contents into a premade table?? Windows 7 64bit Converting a Table of Contents into a premade table?? Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 20,038
macropod has much to be proud ofmacropod has much to be proud ofmacropod has much to be proud ofmacropod has much to be proud ofmacropod has much to be proud ofmacropod has much to be proud ofmacropod has much to be proud ofmacropod has much to be proud ofmacropod has much to be proud ofmacropod has much to be proud of
Default

Try deleting:
Code:
   Set Rng = Tbl.Cell(i + 1, 3).Range
    With Rng
      .Style = Split(StrStlList, "|")(i)
      .End = .End - 1
      .Fields.Add Range:=Rng, Type:=wdFieldEmpty, Text:="PAGEREF " & StrTmp & " \h", PreserveFormatting:=False
      .InsertBefore vbTab
    End With
__________________
Cheers,
Paul Edstein
[MS MVP - Word]
Reply With Quote
  #7  
Old 03-26-2020, 10:39 PM
gavi12 gavi12 is offline Converting a Table of Contents into a premade table?? Windows 10 Converting a Table of Contents into a premade table?? Office 2016
Novice
Converting a Table of Contents into a premade table??
 
Join Date: Mar 2020
Posts: 4
gavi12 is on a distinguished road
Default

I did try that but still shows the numbers in each section..any other suggestions?
Reply With Quote
  #8  
Old 03-26-2020, 10:46 PM
macropod's Avatar
macropod macropod is offline Converting a Table of Contents into a premade table?? Windows 7 64bit Converting a Table of Contents into a premade table?? Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 20,038
macropod has much to be proud ofmacropod has much to be proud ofmacropod has much to be proud ofmacropod has much to be proud ofmacropod has much to be proud ofmacropod has much to be proud ofmacropod has much to be proud ofmacropod has much to be proud ofmacropod has much to be proud ofmacropod has much to be proud of
Default

The effect you're seeing is because the very first paragraph in your document has whatever Style is used there has that particular format applied to it. Try inserting a paragraph in the Normal Style ahead of that one before running the macro.
__________________
Cheers,
Paul Edstein
[MS MVP - Word]
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Creating an Automatic Table of Contents in a Table Jami_Benson Word 2 08-08-2019 04:37 PM
Converting a Table of Contents into a premade table?? Table of Contents -"Permanently" Setting Table of Contents Option KRoger Word 3 03-01-2019 06:36 AM
Converting into a fixed column width table with data alignment&table length under 72 colums samirahmed007 Excel Programming 0 01-18-2019 09:54 AM
Table of contents with section breaks (text in table in header) Dmonk Word 2 05-23-2017 04:29 AM
Converting document to PDF but table of contents doesn't work luthers Word 0 07-30-2009 03:29 PM


All times are GMT -7. The time now is 09:57 AM.


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