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!

VB program to access Ms Word Document Properties

Status
Not open for further replies.

helphelp

IS-IT--Management
Feb 21, 2002
11
MY
Hi all,

I wanted to write a vb program to access the Ms Word Properties. eg. Title, Subject, Comments (in the File -> Properties). Do anyone have any example??? Please help!!!

Regards.
 
I would think its under the CustomDocumentProperties or the BuiltInDocumentProperties. Im not sure, but I would add word as a reference then start searching.

ex.
dim oDoc as word.document
oDoc.BuiltInDocumentProperties Scott
Programmer Analyst
 
Using Word Objects you can get the date and time the document was created and the date and time it was last saved.



Dim oDoc As Document
Dim oProp As DocumentProperty

On Error Resume Next


Set oDoc = ActiveDocument

Debug.Print "Creation date", oDoc.BuiltInDocumentProperties("Creation date")
Debug.Print "Last save time", oDoc.BuiltInDocumentProperties("Last save time")

For Each oProp In oDoc.BuiltInDocumentProperties
Debug.Print oProp.Name, ;
Debug.Print oProp.Value, ;
Debug.Print oProp.Type
Next oProp
Set oDoc = Nothing
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top