' Copyright (C) 2011 TechHit. All rights reserved. ' ' THIS SCRIPT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ' Option Explicit Dim objWord Dim strFile If WScript.Arguments.Count < 1 Then WScript.Echo("Usage: doc2txt.vbs file.doc") WScript.Quit End If strFile = Wscript.Arguments(0) Set objWord = WScript.CreateObject("Word.Application") objWord.Documents.Open strFile objWord.ActiveDocument.SaveAs strFile&".txt", 2 ' For UTF-8 format, use the next line, instead of the one above 'objWord.ActiveDocument.SaveAs strFile&".txt", 2,,,,,,,,,,65001 objWord.ActiveDocument.Close objWord.Quit