Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Changing author and keywords in Word Docs 2

Status
Not open for further replies.

ironpawz

IS-IT--Management
Oct 8, 2002
44
NZ

Has anyone tried doing this with a script? I am not sure about the success of editing Word docs at the text level but will run some tests today. If I use notepad to look at a doc I can see the author info but pulling it and changing it seems difficult but not impossible.

Any ideas experiance out there??

cheers
 
Probably best to load up the document in a hex editor and then do binary changes to the file. I'd look into it, but I don't have word installed here...or any office suite for that matter. The only word docs I can find around are fairly large and difficult to wander though. Regardless, it sounds like an interesting project, though. Shouldn't be very hard. I'd like to see what you come up with if you continue on. ----------------------------------------------------------------------------------
...but I'm just a C man trying to see the light
 

Well I tried a few different things. I tried editing a doc in not pad deleting one letter from the aurther and then re-adding and saving it. That screwed the doc so it will have to be hex editor as you mentioned.
Still all names are different lengths and finding where they start and end looks hard. If I use a hex editor to replace 8 characters with 10 I think I'll still be screwed. MS seems to have a lot of protection for there file format in there somewhere.
I am going to talk to MS about any tools to do this. If you implement a document management system you really want to change this information on everything is various directories first. My perl skills are relatively basic but I can't help feeling it is just not possible eitherway.

If I find something good I'll post it in though.
 
Well, the good news is, it's not a checksum-like routine. If the name is "Bob McHenry" it can easily be changed to "Frank Owens" (same number of characters) in a hex editor and resaved. It seems it can be extended one more character at the end (but not beginning) and it reports alright.

I suppose here'd be a good time to mention my checking method is what explorer reports in the status bar at the bottom when the document is highlighted. When the length is changed, it just reports nothing in its place. It's listed as created with "Word 9.0" Not sure if it's the same version as yours or if it even matters.

My outlook is grimmer now than it was two hours ago with the other post. After wandering about inside one, it might also be difficult to find where it is to edit. The place where I found the author's name that affectively changed the document's properties was some 85% or so into it, so it's not a specific number of bytes into the file's header. Maybe I should just break down and dig office out of the bundled software stack and play with simpler test cases.

Maybe the trick is to find some open-source program that can read in word documents. Such a thing exist? OpenOffice maybe? Probably too huge to wade through. Might be able to ask their source tree. ----------------------------------------------------------------------------------
...but I'm just a C man trying to see the light
 
You might take a look at the Perl OLE stuff. It will let you get into and play with Word docs, Excel spreadsheets, and other such. I have used it to play with spreadsheets, but have never played with a doc. Anywhay, the OLE will give you access to the VB stuff that runs inside Word. See the M$ macro help for the object model for the available methods and such.

see 'hope this helps

If you are new to Tek-Tips, please use descriptive titles, check the FAQs, and beware the evil typo.
 
icrf. Yes finding the name is half the battle. Not only does it seem to move but it is hard to tell where it starts and stops. Is it two names of is the next word something else. I am using office XP (10) but I don't think it matters the format is the same. Interesting isnt it. almost like MS don't want others playing with there document format.

goBoating. Looks like a good lead I'll check it out.
 
goBoating: I took a look and that is very interesting a looks on track. It is a bit beyond me but enough to start. I started a thread on that page so might get some feedback.

Some of the keys look promising
Keys: Creator - 1297307460
Keys: ID -
Keys: Information ...

But I am not sure how to push that info to the document so am reading on. Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top