Setting a document property

B

Bo Rasmussen

Hi,

Could somebody tell me how to set a document property like Title in a macro?
We're using Word 97!

Regards and Thanks in advance
Bo Rasmussen
 
B

Bo Rasmussen

Hi,

Found a BuiltInDocumentProperties property which I could use for this
purpose.

-Bo
 
G

Greg

Bo,

Here is an example:

Sub Test()
Dim Expr1 As String
Dim Expr2 As String
Dim Expr3 As String
Dim oStory As Range

Expr1 = InputBox("Enter the Document Title:", "Title")
Expr2 = InputBox("Enter the Document Author:", "Author")
Expr3 = InputBox("Enter the Document Subject:", "Subject")
ActiveDocument.BuiltInDocumentProperties("Title").Value =
Expr1
ActiveDocument.BuiltInDocumentProperties("Author").Value =
Expr2
ActiveDocument.BuiltInDocumentProperties("Subject").Value
= Expr3

End Sub
 
R

Raknapid Abbus

Greg,

The example's fabulous. However, I have got one more question. It becomes a little tedious for the user to input document properties one by one. Is it possible to combine them into one form?

Thanks in advance.

Raknapid
 

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