Accessing the properties of a MS Word Document 
Author Message
 Accessing the properties of a MS Word Document

Good Day,
I am looking to write a small application which will be able to access
the Title section under the properties of a MS Word document. Example
when one right clicks on the Word file and clicks properties and under
the summary tab, a list of fields are available which could be ammended.
Anyway I need to be able to access and change those fields.
Thanks
Jack


Tue, 16 Nov 2004 09:00:19 GMT  
 Accessing the properties of a MS Word Document
Const wdPropertyAuthor = 3
Const wdPropertyBytes = 22
Const wdPropertyCategory = 18
Const wdPropertyCharacters = 16
Const wdPropertyCharsWSpaces = 30
Const wdPropertyComments = 5
Const wdPropertyCompany = 21
Const wdPropertyFormat = 19
Const wdPropertyHiddenSlides = 27
Const wdPropertyHyperlinkBase = 29
Const wdPropertyKeywords = 4
Const wdPropertyLastAuthor = 7
Const wdPropertyLines = 23
Const wdPropertyManager = 20
Const wdPropertyMMClips = 28
Const wdPropertyNotes = 26
Const wdPropertyPages =  14
Const wdPropertyParas = 24
Const wdPropertyRevision = 8
Const wdPropertySecurity = 17
Const wdPropertySlides = 25
Const wdPropertySubject = 2
Const wdPropertyTemplate = 6
Const wdPropertyTimeCreated = 11
Const wdPropertyTimeLastPrinted = 10
Const wdPropertyTimeLastSaved = 12
Const wdPropertyTitle = 1
Const wdPropertyVBATotalEdit = 13
Const wdPropertyWords = 15

on error resume next
set wordApp = CreateObject( "Word.Application")
set myDoc = wordApp.Documents.Open( "C:\document.doc")

set docProp = myDoc.BuiltInDocumentProperties
msgbox "Title : " & docProp( wdPropertyTitle)
msgbox "Subject : " & docProp( wdPropertySubject)
msgbox "Author : " & docProp( wdPropertyAuthor)

call myDoc.Close()
call wordApp.Quit( 0)

Quote:

> Good Day,
> I am looking to write a small application which will be able to access
> the Title section under the properties of a MS Word document. Example
> when one right clicks on the Word file and clicks properties and under
> the summary tab, a list of fields are available which could be ammended.
> Anyway I need to be able to access and change those fields.
> Thanks
> Jack



Tue, 16 Nov 2004 09:58:54 GMT  
 Accessing the properties of a MS Word Document
And if you need to modify property values just assign new value to document
property element.

ie
docProp( wdPropertyTitle) = "mK"

And make sure you save the changes

call wordApp.Quit( 1)  '1=Save changes, 0=Dont save

Quote:

> Good Day,
> I am looking to write a small application which will be able to access
> the Title section under the properties of a MS Word document. Example
> when one right clicks on the Word file and clicks properties and under
> the summary tab, a list of fields are available which could be ammended.
> Anyway I need to be able to access and change those fields.
> Thanks
> Jack



Tue, 16 Nov 2004 10:04:14 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Accessing the properties of a MS Word Document

2. Accessing the properties of a MS Word Document

3. Accessing the properties of a MS Word Document

4. MS Word Document Properties from Docs on NT LAN

5. MS/Access.adp access to Custom Document Properties

6. Extracting of MS-Word Document Properties

7. MS Word Document Properties from Docs on NT LAN

8. Accessing MS-Office 95 builtin document properties with VB

9. Accessing MS Word document in OLE Container Control

10. URGENT: Accessing MS Word Documents

11. Accessing MS Word document in OLE Container Control

12. x/y graphing and links to MS-Word documents from Access DB

 

 
Powered by phpBB® Forum Software