Macro to convert all .txt files to .doc

H1SOKA

New Member
Joined
Mar 17, 2016
Messages
38
Hey guys,

Pretty simple question if you have the time.

I'm trying to figure out how you can convert a whole folder worth of text files to word documents.

I have about 50,000 documents that need to be converted from .txt to .doc :eeek:

The converted files should keep their original filenames too.

Am I asking too much?

Thanks.
 

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).
Maybe just

cd \Path\To\Your\Folder
ren *.txt *.doc

from the Windows Command Prompt?
 
Last edited:
Upvote 0
Maybe just

cd \Path\To\Your\Folder
ren *.txt *.doc

from the Windows Command Prompt?
Do note that while Word will treat such files as Word documents, they don't have the correct binary format for .doc files and other applications may not handle them correctly.
 
Upvote 0
Maybe just

cd \Path\To\Your\Folder
ren *.txt *.doc

from the Windows Command Prompt?
As Paul said, that doesn't do any sort of conversion, it just changes the file extension.

I once had a co-worker who thought you could convert Excel files to text files by changing the extension like that from "xls" to "txt", and couldn't understand why it didn't work. I told them, file extensions are arbitrary. They often give you a "clue" what the file type is, but you could conceivably change it to anything, even ".bob", and that doesn't change anything in the file at all. You are just changing the name of the file, that's it.
 
Upvote 0
As Paul said, that doesn't do any sort of conversion, it just changes the file extension.

I once had a co-worker who thought you could convert Excel files to text files by changing the extension like that from "xls" to "txt", and couldn't understand why it didn't work. I told them, file extensions are arbitrary. They often give you a "clue" what the file type is, but you could conceivably change it to anything, even ".bob", and that doesn't change anything in the file at all. You are just changing the name of the file, that's it.
We don't know the purpose of the conversion.
If it's just to change the default program for opening the files, then the suggested solution will work -- MS Word will open the renamed files without any hesitation.
This, however, may not be the case for other applications, as Paul already pointed out.
 
Upvote 0
We don't know the purpose of the conversion.
If it's just to change the default program for opening the files, then the suggested solution will work -- MS Word will open the renamed files without any hesitation.
This, however, may not be the case for other applications, as Paul already pointed out.
True, but based on the question:
I'm trying to figure out how you can convert a whole folder worth of text files to word documents.
I am simply pointing out the fact that changing the file extension itself will not convert anything.
Changing the file extension may change the default program that opens it up, and then it might go through some default conversion that Word automatically deems, which may or may not be what they are after.

Just want to make sure that they know exactly what it will (and won't) do. As I said, I have seen people try this method before under the assumption that it would do something different.
 
Upvote 0
Agree. In the strict sense, the suggested solution is not a conversion, but mere renaming.
 
Upvote 0

Forum statistics

Threads
1,223,798
Messages
6,174,667
Members
452,576
Latest member
AlexG_UK

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top