Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Convert lots of WP files to Word 1

Status
Not open for further replies.

IFRs

Programmer
Mar 28, 2003
327
US
My office has zillions of DOC files that are not Word files but can be opened in Word. What is the best way to convert them to Word? They could be opened and "SaveAs" Word but that would take weeks. Would it be possible to write a macro or VBA that opened each file in a folder (or even better, the whole drive) and then did SaveAs? Is there a better way? I only have to do this once and the files are all on one server (but multiple folders). Many thanks!!
 
A starting point (typed, untested):
strDoc = Dir("*.wp")
While strDoc <> ""
Documents.Open FileName:=strDoc, Format:=wdOpenFormatAuto
ActiveDocument.SaveAs FileName:=strDoc, FileFormat:=wdFormatDocument
strDoc = Dir
Next

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
PHV - thanks. All the files have DOC extensions. Trouble is, I can't open all of them with OpenOffice because some of them are not Word docs but WordPerfect or maybe Works (I don't know). If this works, it will be awesome! I'll change the WP to DOC and try it. Thanks!!
 
The Next needs to be Wend
Somehow the "strDoc = Dir" line does not look right. How does it step through the list?
 
I changed wp to doc and added ActiveDocument.Close just before strDoc = Dir and it seemed to work at home. I'll try it at work. Hope it works in the version of Word at work (97 if you can believe that!!). If not, I'll burn all the docs to a dvd and bring them home.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top