removign 'author' and 'company' properties from a Word document

R

Roel Vanhout

Hi,

I have a requirement to remove the 'author' and 'company' properties
from Word documents programmatically (these are the properties that you
can see when going to 'File->Properties'). I thought I could automate
Word to do this, but I can't find any properties in the object model
that correspond to these properties - is it possible?

Alternatively I'll have to edit the .doc files 'the hard way', i.e. by
opening it and writing to it from code (using fopen() etc.). Is there
any documentation on the Word file format that describes how I can get
the offset of where this data is stored in the .doc file? I've briefly
looked at some .doc files in a hex editor but I don't really see a
pattern on where the properties are located in the document. Thanks.

cheers,

roel
 
S

Steve Rindsberg

Hi,

I have a requirement to remove the 'author' and 'company' properties
from Word documents programmatically

These are built-in properties; you can't remove them but you should be able
delete any existing text in them, set them to "" or "YOU PEEKED!" or whatever
else you'd like.

These are both from a PowerPoint perspective but should be adaptable to Word:

Sub SillyExample()
ActiveDocument.BuiltInDocumentProperties("Author") = "Stop staring at me!"
End Sub


Show me the built in properties and their values
http://www.pptfaq.com/FAQ00751.htm

Get DOCUMENT PROPERTIES without opening each file
http://www.pptfaq.com/FAQ00174.htm
 

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

Top