User-defined properties in a Word Document

M

Marketware

Is it possible to create user-defined properties in a Word Document? If so,
how? Thanks!!
 
D

Doug Robbins - Word MVP

You can use either CustomDocumentProperties or Document Variables.

I prefer to use Document Variables as they can only be changed through the
use of VBA, but the data stored in them can be displayed in the document by
use of a { DOCVARIABLE varname } field.

To assign a value to a document variable named varname in the active
document, you would use the following code

ActiveDocument.Variables("varname").Value = "Type here whatever it is that
you want to store in the variable."

If in that document, you had a { DOCVARIABLE varname } field, it would
(after being updated), display:

Type here whatever it is that you want to store in the variable.

Exactly what do you want to do?

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP, originally posted via msnews.microsoft.com
 

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