Hi,

My background is with databases not VBA so apologies if this seems simple.

I have a folder

\\data\

it has 30+ subdirectories called
\\data\TestGroupxx
where xx is number between 1 and 34


in each of these subdirectories I have approx 450 .docx files, each has a Table of Contents "TOC".

I need to put an excel spreadsheet into \\data\ that has a macro which
1) Scans for subdirectories
2) For each directory create a new worksheet in the workbook
3) Scan each directory looking for .docx files
4) For each file retrieve the TOC
5) For each TOC line put an entry into the worksheet
Column A = Document Name ( eg Primary Compound Analysis.Docx)
Column B = TOC Level ( eg 3.1.2)
Column C = TOC Text ( eg Initial analysis of Carbon compound )
Column D = TOC Page Number ( eg 28 )

Does anybody have any code I could leverage, sample urls that might give me a clue ? I had a look on this site and stack overflow, but the code seems orders of magnitude beyond me