Copy TOC & TO Figures

S

saybut

Hi,

I have a slight problem at them moment and wondering if anyone coul
help?

I am trying to copy the Table of contents out of several word document
and paste them into excel. In the documents though I have three "TOCs"
one is the overall TOC, the next is a list of Figures/Graphs, and th
third is a list of tables which appear in the document.

In column A I have a list of the document names, is there anyway fo
excel to look in a folder and only open bring back the TOC's for th
relevant documents which are listed in Column A?

Any help would be greatly appreciated, I am just a begginner in VB bu
know my way around enough. I managed to create a macro in word to ope
each file in a list and switch on "Track changes", I just can't seem t
use similar code to open each document through excel.
Regards,

Mark Pitchford
 
D

David McRitchie

Hi Mark,
I read first as you wanting to have only a selection of names matching
something in A.
If you have the name by itself in a specific column within the TOC area
that you can match with column A, You could either filter or use a column
next to the TOC, The following produces True or False
=COUNTIF(A:A,E2)>0
Or perhaps you have a specific location within the description to check.

But I see that you want to read a directory somewhere using the names
in Column A and extract something. If you are looking to extract entire
TOC area from word documents, then you would probably be better off posting
to a word newsgroup. Not clear where you want to extract from, but
if it is the TOC maybe a word person would suggest how to extract the
TOC. Also once located I guess you just want to place the extraction at
the end of the worksheet, but it would probably be better to be more
explicit as to where you want to put the extracted material.
What is the actual purpose. Is it a Table of Contents of Table of Contents.
 
S

saybut

Hi David,

Thank you very much for your reply. I think I may need to post to
word forum. Sorry if my post was slightly confusing.

It's actually a Table of Contents. In the word document I have a titl
page. Then below I have a table of contents for that document listin
all the relevant chapters etc. Then on the next page I have a list o
tables, listing all tables in the doc, and finally I have List o
figures listing all the figures in the document.

In column A of my spreadsheet I have a list of document names whic
relate to documents in a folder. It would look like:

a b c d e f etc.....
 
Top