Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Pages in a Word doc without opening it?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Divers
Thread ID:
00891605
Message ID:
00891906
Vues:
15
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.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform