Modify Word Doc with Python

Ian Bicking ianb at colorstudy.com
Sun Apr 7 15:05:32 EDT 2002


On Sat, 2002-04-06 at 02:15, David McInnis wrote:
> I need to alter the document properties of Word DOCS that our users
> upload to our Web site.  Does anyone know how to do this?  (I am python
> installed on a Linux box).

I've done some exporting from Word using wvWare (wvware.com).  It works
reasonably well if you don't mind loosing some layout.  However, it
doesn't seem appropriate for what you want.  wvSummary will read the
properties, but not write it.

The document properties you are talking about (NOT custom document
properties, just the normal ones) are part of the OLE file format --
i.e., they aren't specific to Word, and code that manipulates Excel
documents would work identically.  It's also well-documented compared to
the Word format that's contained in the OLE format.

Unfortunately, I've looked around a bit and haven't found such a thing
separated out as a single command-line tool or library -- I assume
support exists in some programs (Gnumeric, perhaps), but I haven't had
that much motivation to dig through such large amounts of source code. 
Such a program might yet exist, however, as "console" contains "ole",
and so you have to sort through a million console applications to fine
an OLE application :P

  Ian







More information about the Python-list mailing list