Hey,
So, I was able to convert one word document to .txt format (See Code below).
Now, I don't want to specify the Exact name of the word document. I would like the script to identify the word document in a Particular Folder and then convert it to .txt
Here is What I have so far:
Any help will be greatly appreciated.
So, I was able to convert one word document to .txt format (See Code below).
Code:
Dim objWord, objDoc
Set objWord = CreateObject("Word.Application")
Set objDoc = objWord.Documents.Open("C:\VBS\Testing.docx")
objDoc.SaveAs "C:\VBS\Testing.txt", 2
objDoc.Close
objWord.Quit
Set objDoc = Nothing
Set objWord = Nothing
msgbox "Word Document Converted to Text."
Now, I don't want to specify the Exact name of the word document. I would like the script to identify the word document in a Particular Folder and then convert it to .txt
Here is What I have so far:
Code:
Dim objWord, objDoc, objFSO, objFolder, objFile
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objWord = CreateObject("Word.Application")
Set objFolder = objFSO.GetFolder("C:\VBS\")
For Each objFile In objFolder.Files
Set objDoc = objWord.Documents.Open("C:\VBS\")
objDoc.SaveAs "C:\VBS\", 2
objDoc.Close
objWord.Quit
Set objDoc = Nothing
Set objWord = Nothing
Next
msgbox "Word Document Converted to Text."
Any help will be greatly appreciated.