Thanks - this worked. Here is the program for the benefit of others:
* Program DsoDemo.Prg
* Written by R Mortimer - 3 April 2004
* To Read Office Docuemnt Properties without Opening the Document
lcFile = GETFILE("DOC,XLS", "Read File", "Select", 1 ,"Select Word or Excel Document to read properties")
IF EMPTY(lcFile)
RETURN
ENDIF
* You need to have downloaded:
*
http://download.microsoft.com/download/office97dev/Utility/2/WIN98/EN-US/Dsofile.exe* Extracted Dsofile.exe and register it using:
* Regsvr32 (Insert Path) + DSOFile.dll
loReader = CREATEOBJECT("DSOleFile.PropertyReader")
* Note the File lcFile should not be open or you will get an error
loProperties = loReader.GetDocumentProperties(lcFile)
lnProperties = AMEMBERS(laProperties, loProperties, 3)
? "List of properties of: " + lcFile
FOR ln = 1 TO lnProperties
? laProperties(ln,1), laProperties(ln,2), laProperties(ln,3), laProperties(ln,4)
lvValue = loProperties.&laProperties(ln,1)
IF TYPE("lvValue") <> "O" && Maybe Custom Properties, Icon Properties etc
? CHR(9) + laProperties(ln,1) + " = ", lvValue
ELSE
? CHR(9) + laProperties(ln,1) + " is an OBJECT"
ENDIF
NEXT
?
? "End .... List of properties of: " + lcFile
loProperties = .NULL.
loReader = .NULL.