Scan directory, extract word TOC data

Paula.Scorchio

New Member
Joined
Aug 29, 2012
Messages
2
Hi

I have a folder called

\\data\

underneath it I have 30+ directories each containing 300+ word documents.

\\data\TestGroup01\
\\data\TestGroup02\
...
\\data\TestGroup31\

I need to place an excel spreadsheet in \\data\

It should contain a macro that loops through \\data\TestGroupXX\
For each directory it should
1) create a new worksheet.
2) Scan the directory for .doc files
3) For each .doc file it should scan the Table of Contents "TOC" data
4) For each TOC line it should write a line to the worksheet

Document Name ( eg Compound Analysis.doc)
TOC Heading (eg 3.1.1)
TOC Title (eg Compound Analysis)
TOC Page# ( eg 18)


To be honest my background is more databases, so this is a big learning curve for me. Does anybody have any sample code I could leverage / pointers to other websites. I had a quick look on stack overflow, but the code there is orders of magnitude beyond me.

I can visualise the loops I need, I just can't get the various commands to gel, any help would be much appreciated.

Ta
 

Excel Facts

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.

Forum statistics

Threads
1,215,943
Messages
6,127,814
Members
449,409
Latest member
katiecolorado

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top