Link to home
Start Free TrialLog in
Avatar of avi666
avi666

asked on

word document properties access in vba

i would like to know how i can read rapidly the word documents' properties
(like author, subject, comments, title
  etc.) in vba script as windows does.
Avatar of ture
ture

avi666,

Use ActiveDocument.BuiltInDocumentProperties, like this:

MsgBox ActiveDocument.BuiltInDocumentProperties("Author")

MsgBox ActiveDocument.BuiltInDocumentProperties("Subject")

MsgBox ActiveDocument.BuiltInDocumentProperties("Comments")

Ture Magnusson
Karlstad, Sweden
Also, a for next loop from 1 to maxindex
with
ActiveDocument.BuiltInDocumentProperties(i)
in it accesses all options

Don't forget customdocumentproperties(i)
is for custom doc. prop's.
Avatar of avi666

ASKER

i apologize for being missunderstood.
i didn't mention that i would like to read the word document's prop's without
activating the doc (which ofcourse make it slower).
that why i can't use
activedocument.buildindocumentproperties
or add doc's to collection and then
use documents(index).buildin...

ASKER CERTIFIED SOLUTION
Avatar of yonat
yonat

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of avi666

ASKER

just what i was looking for