DOC2TXT(1)

NAME
DOC2TXT - Word OLE Document Converter

SYNOPSIS
DOC2TXT.EXE [-cr] [[-o dir|-O] [-e|-E ext] [-k|-w]|-s] [-f format] [-CS] [-P progid] [-DqWvh] [--] file [...]

DESCRIPTION
DOC2TXT is a Win32 console application that converts the Microsoft(R) Word document files into another document format (by default simple-text files) using the Word OLE interfaces.

The input and output formats that DOC2TXT supports are dependent on your Word application. The format of input
files are automatically determined by Word. The output format can be configured by the -f command-line option.
Therefore, DOC2TXT can be used as a bidirectional document converter between Word document, Word template, text, RTF, HTML and Unicode text files, beyond its command name.

By default, DOC2TXT creates the output in the current directory where the program has been run. The output directory can be configured via -o or -O option, or set to stdout by -s option.

Each output filename is generated from the basename of corresponding input file and the appropriate extension for the output format. You can specify the output extension using -e or -E option. The default extensions are:

.doc Word document (-fw)
.dot Word template (-fl)
.txt ASCII text, DOS text, Unicode text (-f{tTdDu})
.rtf RTF (-fr)
.html HTML (-fh)

If the output file already exists, DOC2TXT appends a 2-digit sequential number (from 1 to 99) to the basename, just like Windows Explorer does. For example, the new filename may be "filename (1).txt", "filename (2).txt" and so on. This behavior can be changed by -w or -k option, to overwrite or skip the existing file.

There are some more options that may help you automate the conversion process. For more information, see the OPTIONS section below.

OPTIONS
Options are case sensitive. Both '-' and '/' are recognized as switch characters for a short option, but only "--" can be used to specify a long option.

Input and Output Options
-c
--no-cygwin-path
Disables the support for Cygwin 1.1 mount volumes.
By default, DOC2TXT tries to resolve the Cygwin-style paths (except "/", which is resolved to the root directory of the current drive) to Win32 native paths. If this option is specified, DOC2TXT does not read the Cygwin's mount information. This option must be specified prior to any path parame-ters. If a path appeared before this option and matched one of the mount volumes, it is still parsed using that mount information.

-r
--recursive
Searches the input files recursively. For example, if you specify an input filename "C:\home\mydoc.doc" with -r option, DOC2TXT searches "mydoc.doc" files from the "C:\home" directory and its subdirectories.

-o dir
--outdir=dir
Specifies the output directory. If neither -o, -O nor -s option is specified, the output files are created in the current directory. This option can-not be used with -O or -s.

-O
--origdir
Saves the output files in the same directories as input files. This option cannot be used with -o or -s.

-e ext
--change-extension=ext
Uses ext as an extension to name output files. This option replaces the original extension with ext, for example, -e man saves the "mydoc.doc" file as "mydoc.man". If neither -e nor -E is used, DOC2TXT changes the extension of each input file to default one according to the output format. This option cannot be used with -E or -s.

-E ext
--append-extension=ext
Uses ext as an extension to name output files. This option does not remove the original extension, but appends ext after it. For example, -E man saves the "mydoc.doc" file as "mydoc.doc.man". This option cannot be used with -e or -s.

-s
--stdout
Writes conversion results to the standard output instead of saving into files. This option cannot be used with -o, -O, -e, -E, -k or -w.

-k
--skip-existing
Does not perform conversion if the output file already exists. When an existing file is found, this option generates a warning message. If neither -k nor -w option is specified, and the output file already exisits, DOC2TXT tries to create a unique filename by appending a sequential number to the basename.

-w
--overwrite
Overwrites existing output files (if any).

Word Options
-f format
--format=format
Specifies the save format, where format is any one of the format numbers, abbreviations, format names or alternative names in the following list:

0, w, wdFormatDocument, document, doc
1, l, wdFormatTemplate, template, dot
2, t, wdFormatText, text, txt
3, T, wdFormatTextLineBreaks, textlinebreaks
4, d, wdFormatDOSText, dostext
5, D, wdFormatDOSTextLineBreaks, dostextlinebreaks
6, r, wdFormatRTF, rtf, richtext
7, u, wdFormatUnicodeText, wdFormatEncodedText,
unicodetext, encodedtext, unicode
8, h, wdFormatHTML, html, htm

For example, -f 0, -f w, -f wdFormatDocument and -f doc are all identical, in which case the input files are saved in Word document format. Note that the abbreviations are case sensitive, while the symbols and alternative names are case insensitive.

-C
--remove-comment
Removes all comments from Word documents. This option never generates an error even if the delete operation failed.

-S
--remove-style
Removes user-defined styles from the original documents and resets all paragraphs and characters to the default style ("Normal" and "Paragraph Font").
Built-in styles are not affected. This option never generates an error even if the delete operation failed.

-P progid
--progid=progid
Specifies the Word program ID to create an Application object. This option is provided for testing and debugging purpose.

Miscellaneous Options
-W
--exit-on-warning
Assumes a warning message as an error. A warning message is generated when an input file could not be saved (for example, because of the invalid path or access violation). Unless this option is specified, DOC2TXT usually reports these warnings on the stderr and continues processing.

-q
--quiet
Quiet mode. Does not display any logs and warning messages. However, a fatal error that caused the program to abort is still reported.

-D
--debug
Debug mode. Displays what is (or will be) done and exits without actually saving files. Use this option when you think something is going wrong and need to report the problem to the author.

-v
--version
Displays version information.

-h
-?
--help Displays command-line help.

COPYRIGHT
Copyright (C) 1999-2000, <rei@wdic.org>.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

DOC2TXT Ver.1.5 December 2000 4

