Outputting files from a custom application in MS Word Binary Format

  • Thread starter Thread starter Rod Colen
  • Start date Start date
R

Rod Colen

I am developing an internal company software application
that executes on UNIX platforms. I need the application
to have the capability of outputting reports directly in
Microsoft Word binary format. These reports - not the
software application - are deliverables to our customers,
and must be in the Microsoft Word 97 binary file format
per customer contract requirements. Hence, some of the
solutions to this problem using current Microsoft Word
capabilities may not be applicable.

The contect specification of the generated files is fixed;
i.e., the software application will not open or edit a MS
Word binary formatted file. If the file my application
produces need further editing, the files would be
transfered to a PC compable computer and Microsoft Word
itself would be invoked.

The output file specification is to-be-determined, but
something along the lines of:

Document Properties

Definition of Styles
Heading 1
Style 1
Style 2
Style 3
Style 4
etc.

Heading 1

Text of Style "Style 1"

Table of multple Columns and Rows
Table Header in first row of Style "Style 2"

Cells of information (Differing Styles per Row
Cell)
Table Sub Header of Style "Style 3"
Cells of information (Differing Styles per
Row Cell)

Repeat Cells/Sub Header


Text of Style "Style 4"

Does anyone have an example of a Microsoft Word binary
file and the source code used to produce the file that
could be provided to me? Preferably, the source would be
portable C code.


Thanks in advance for any assistance.
 
The internal format of a Word file is a complex beast, comprising a text
fork (the content of the document) and a data fork (style definitions,
macros, versions, and a squillion other bits and pieces). Not only does
Microsoft not publish the file format, but -- according to some contacts at
Symantec who have worked with it -- for security reasons it's polymorphic in
obscure and deliberately mysterious ways.

In other words, for practical purposes there's no way to generate a Word
binary file without using the Word application.

After you've shot the person who signed your contract, consider these
alternatives:

1. Output to RTF. Word is happy with that, even if your customer isn't :)

2. Output to HTML using Word's customised stylesheet format. Word can use
HTML as a 'native' format. (On second thoughts, not sure that Word 97 can do
that.)

3. Output to any convenient format, convert to PDF, then use Acrobat to save
as Word.

4. Attach a PC to your Unix box and use that as your output generator.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top