Link to home
Start Free TrialLog in
Avatar of astynes
astynes

asked on

How to rename Thousands of Word Documents based on the contents of the Document

Due to a tech here reimaging a Hard drive and wiping the contents I have gotten back all the data but they are numbered File001  file 002 ect I have tried to do a script

Set objWord = CreateObject("Word.Application")

Set objDoc = objWord.Documents.Open("c:\scripts\test.doc")

Set objRange = objDoc.Range(0,5)
strNewName = "C:\Scripts\" & objRange.Text & ".doc"

objWord.Quit
Wscript.Sleep 3000

Set objFSO = CreateObject("Scripting.FileSystemObject")
objFSO.MoveFile "C:\Scripts\Test.doc", strNewName

Open in new window

Now that only renames the test .doc and try as I might I cannot get this to do Multiple files  as I dont have the Knowledge

Thank you in Advance
ASKER CERTIFIED SOLUTION
Avatar of Bill Prew
Bill Prew

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of astynes
astynes

ASKER

Thank You so Very Much ,Much appreciated

A