Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Changing Company Name from Visual C++ exe

0 views
Skip to first unread message

Ken Freed

unread,
Jan 24, 2001, 1:18:28 PM1/24/01
to
I have recently written a Visual C++ utility to change the company name
field of a word file (actually an OLE compound document).

The manager, category, and company name fields are stored in an area called
"DocumentSummaryInformation", while the other property information (e.g.
author, etc.) is stored in an area called "SummaryInformation"

Microsoft provides good hooks for changing the property fields in the
"SummaryInformation" area, but alas, I had to decode the binary
"DocumentSummaryInformation" area to be able to change the company name
there. (Needless to say, figuring out this undocumented format, all the
ways it can change around, and where the pointer fields are for
expanding/inserting the company name field -- was a lot of work).

My exe seems to work for most word 97 and 2000 files -- EXCEPT that there is
an occasional Word 2000 file which has yet another new format arrangement
(the company name field winds up after the title field, which is normally
one of the last fields, for those who've looked at this). I can't seem to
replicate saving files in this new format variation when I use Word 2000
(they all save into the format I am familiar with).

Q1: Does anyone know of a utility which will cleanup/defrag word doc files
which were (e.g.) saved via the "fast save" option? (I'm sure this will put
them into the format which I've decrypted and can work with).

Q2: Does anyone know of actual Visual C++ OLE compound document code (which
works-there is a PID_COMPANYNAME define, but I can't successfully open the
DocumentSummaryInformation area as an OLE substorage stream) to access the
DocumentSummaryInformation fields?

Q3: Does anyone have any information/source code on the binary formatting
of the DocumentSummaryInformation area? (so I can compare mine with yours)

Q4: Has anyone else written a scriptable (meaning it takes a command line
argument) exe which will automatically change the company name field in a
word document? (I'm not proud - if you've done this before can I have it?).


Thanks! - Ken Freed (kfr...@jumpnet.com, ken....@athensgroup.com)


0 new messages