Open notepad and enter:
CopyCode The Code is as follows: on error resume next
Set ARGs = wscript. Arguments
Arg = ARGs (0)
Set W = Createobject ("word. application ")
Set FSO = Createobject ("scripting. FileSystemObject ")
Set docfile = FSO. GetFile (ARG)
Docpath = docfile. Path
PT = left (docpath, Rev (docpath ,"\"))
Txtpn = PT & left (docfile. Name, Rev (docfile. Name, ".") & "TXT"
Invalid Doc uments. Open docpath, false
Using Doc uments (docpath). Activate
W. activedocument. saveas txtpn, 2
W. activedocument. Close
W. Quit
Set W = nothing
Save it to "C: \ WINDOWS \ doc2txt. VBE ".
Notepad editing
Createobject ("wscript. Shell"). regwrite "hkcu \ docfile \ shell \ convert to text document \ command \", "wscript.exe c: \ windows \ doc2txt. VBE"
Notepad editing
Createobject ("wscript. Shell"). regwrite "hkcu \ docfile \ shell \ convert to text document \ command \", "wscript.exe c: \ windows \ doc2txt. VBE % 1"
Save the preceding content as *. vbs. After running the command, right-click the DOC file and you will see the "convert to text document" item. Click it to quickly convert it to text document.
The above content is tested in Win2000 and word2003.
During the test, I found that after the script written to the test table is run, the conversion menu is sometimes not displayed by right-clicking the doc. You can change the docfile In the second script *, add a conversion item in the context menu of all types of files.
Alternatively, place the doc2txt. VBE file in the "sendto" folder, right-click the DOC file, and select "send ~ Doc2txt. VBE ", which can also be converted.
This method can also convert HTML, RTF, and other files into text documents.