Rob van der Woude's Scripting Pages

Help text for Word2Txt.cs

(view help text of Word2Txt.cs as plain text)

Word2Txt,  Version 1.03
Extract plain text from a Word document and send it to the screen

Usage:   Word2Txt    "wordfile"  [ encoding | /D ]

or:      Word2Txt    /E

Where:   wordfile    is the path of the Word document to be read
                     (no wildcards allowed)
         encoding    force use of alternative encoding for plain
                     text, e.g. UTF-8 to preserve accented characters
                     or IBM437 to convert unicode quotes to ASCII
         /D          use the encoding specified in the document file
                     (for .DOCX and .ODT only, if Word isn't available)
         /E          list all available encodings

Notes:   If a "regular" (MSI based) Microsoft Word (2007 or later)
         installation is detected, this program will use Word to read
         the text from the Word file, which may be ANY file format
         recognized by Word.
         If Word was already active when this program is started, any
         other opened document(s) will be left alone, and only the
         document opened by this program will be closed.
         If Word is not available, the text can still be extracted, but
         only from .DOC, .DOCX, .ODT, .RTF and .WPD files.
         This program requires .NET 4.5.
         Return code ("errorlevel") 0 means no errors were encounterd
         and some text was extracted from the file; otherwise the
         return code will be 1.

Written by Rob van der Woude
https://www.robvanderwoude.com

page last uploaded: 2020-03-25