Abstracting text from WORD into Excel

R

Robin Clay

Greetings !

I have some (OK, several hundred....) Word documents most of which contain
the words "Contract" followed by the Contract number, "Date" followed by the
contract date, and "Value" followed by its value.

Curiously, I wish to search all the WORD documents in the various folders,
and, where they exist, extract those three values and paste them into an
Excel spreadsheet, with also the path and name of the files from which they
came.

Fairly straightforward requirement - but I just don't know where or how to
even START !

..txt files I could do easily.....

Any help would be much appreciated.
 
P

PY & Associates

We would turn on the macro recorder in Excel;
with A1 of sheet 1 highlighted, click Data/Import External Data/Import Data;
select text file, delimited with space;
the whole of the word document is now in Excel with one word in each cell;
now Edit/Find "Contract" the next cell is the contract number you want to
copy to say sheet 2;
repeat find with "Date" and "Value";
copy text file fullname property also;

You have macro for the first file.
Look up archive to loop through all folders;
stitch them together, you are done.
 
R

Robin Clay

PY & Associates said:
We would turn on the macro recorder in Excel;.....

Thank you very much indeed !

I've not tried it yet, but that looks EXACTLY what I sought !

I'm very grateful.
 
Top