Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 355
  • Last Modified:

Resave a file automatically in word

Is there a way I can run a script to look in a folder that has
wordpad files, open those files in word and resave them as
word files in another directory?

Thank you
  • 4
1 Solution
alagurjanTechnology LeadCommented:
To find all the files in a location and from this you have to select only the word files

Set fso = CreateObject("Scripting.FileSystemObject")
  sFolder = Wscript.Arguments.Item(0)
  If sFolder = "" Then
      Wscript.Echo "No Folder parameter was passed"
  End If
  Set NewFile = fso.CreateTextFile(sFolder&"\FileList.txt", True)
  Set folder = fso.GetFolder(sFolder)
  Set files = folder.Files

To copy the files from one location to other

dim filesys

set filesys=CreateObject("Scripting.FileSystemObject")

If filesys.FileExists("c:\sourcefolder\anyfile.txt") Then

filesys.CopyFile "c:\sourcefolder\anyfile.txt", "c:\destfolder\"
cbonesAuthor Commented:
I'm sorry, I may have phrased my question wrong.  I am looking to search a directory that has txt files in it and resave those files as microsoft word files (.doc).
Try this program, I have tried a small research, it is program - please do download and try this whether it meets the requirements or you might have to wait for someone else to write a script, which would be useful, until than try this!

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

For those experts who will be able to understand and solve this Question, just an idea .

Check this website, if it is help the program and it codes!

This is the idea for the folder watcher, which is on my first comment! This is how it suppose to work, try that out! It worked for me...hope it works for you as well! Thanks! Read this link!

And this is the manual converter program which you see on my above comment!


Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now