Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / May 2006

Tip: Looking for answers? Try searching our database.

Retrieving "Custom Properties" MetaData from Word Documents

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
jamiedora@yahoo.com - 12 May 2006 14:18 GMT
Hello,

I was wondering if anyone could help.  I am trying to retrieve metadata

from a series of word documents.  I wish to tag each document's meta
data with custom properties (Name, Value, Type).

I am able to retireve summary info. such as "Author", but when I try to

access ther properties using the "sld2" variable I get the empty
string.  Here is my code:

Public Sub RetrieveMetaData()
Dim sId
Dim sld2
Dim objShell
Dim objFolder
Dim objItem As Object
Dim DocProp
Dim strPath As Variant
Dim objFolderItem
Dim objword As Word.Application
Dim WordDocument As Word.Document
Dim objTree As TreeView
Dim objTargetNode As Node
Dim X As Variant

Set objTree = Me.xTree.Object
Set objShell = CreateObject("Shell.Application")

sId = "{F29F85E0-4FF9-1068-AB91-08002B27B3D9}"  'Summary information
property set. Defined in Ntquery.h.
sld2 = "{D5CDD505-2E9C-101B-9397-08002B2CF9AE}"

Title = "2"
Subject = "3"
sAuthor = "4"
Comments = "6"

X="?????????"

  strDocument = "Test.doc"
  strPath = "C:\"
  Set objFolder = objShell.NameSpace(strPath)
  Set objFolderItem = objFolder.ParseName(strDocument)
  strDocumentInfo = objFolderItem.ExtendedProperty(sId & Comments)
  strCustomInfo= objFolderItem.ExtendedProperty(sld2& X)

End Sub
Jonathan West - 12 May 2006 14:58 GMT
Shell.Application can only retrieve built-in properties. It can't retrieve
custom properties. For that you need to do one of three things.

1. Open the file in Word and use the CustomDocumentProperties collection.

2. Use DSOFILE.DLL to open the file and retrieve custom properties

3. Read the properties directly using C++
http://support.microsoft.com/kb/186898/EN-US/

Signature

Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup
Keep your VBA code safe, sign the ClassicVB petition www.classicvb.org

> Hello,
>
[quoted text clipped - 45 lines]
>
> End Sub
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.