L
Larry
I've installed the ListProps template and Dso.exe (which seems to have installed "DS OLE document propreties 1.4 Object Library" in Tools, References), and it works. Using the listfilesproperties macro in the ListProps template I can create a table of the chosen properties of the documents in a folder, like this:
List of files from C:\Documents\Tests\
File name
Version
aaaaa.doc
6/95
Test.doc
6/95
testing delete.doc
6/95
But what I want to do is to dispense with the dialog box that comes with listfileproperties and run a simple macro to displays a message box showing the Version property just for the current document, not for all the documents in a folder. One of the MVPs, I think it was Jonathan West, suggested I could dig into the code in the ListProps template (or rather the code connected with the form that listfilesproperties opens) and create my own macro. But it's tricky, as the original macro is extremely long and complicated with many variables and with much of the code related to running the listfileproperties dialog box which browses to a folder, chooses multiple properties, and so on, none of which I need. So it's hard to figure how to work this into a simple code that returns just the Version property of the current document. I copied the lines of code from the macro that seem to be related to the task I want to achieve. Can anyone give me an idea of how to work these fragments into the code I want? It seems that what I really want to get at is that oDocProp.Version. I didn't copy the whole macro into this message as it is very long.
Thanks very much.
Larry
Option Explicit
Private oFilePropReader As DSOleFile.PropertyReader
Private oDocProp As DSOleFile.DocumentProperties
Dim strPropText As String
Set oDocProp = oFilePropReader.getdocumentproperties( _
WordBasic.FileNameInfo$(.FoundFiles(iFileIndex), 1))
strPropText = oDocProp.Version
List of files from C:\Documents\Tests\
File name
Version
aaaaa.doc
6/95
Test.doc
6/95
testing delete.doc
6/95
But what I want to do is to dispense with the dialog box that comes with listfileproperties and run a simple macro to displays a message box showing the Version property just for the current document, not for all the documents in a folder. One of the MVPs, I think it was Jonathan West, suggested I could dig into the code in the ListProps template (or rather the code connected with the form that listfilesproperties opens) and create my own macro. But it's tricky, as the original macro is extremely long and complicated with many variables and with much of the code related to running the listfileproperties dialog box which browses to a folder, chooses multiple properties, and so on, none of which I need. So it's hard to figure how to work this into a simple code that returns just the Version property of the current document. I copied the lines of code from the macro that seem to be related to the task I want to achieve. Can anyone give me an idea of how to work these fragments into the code I want? It seems that what I really want to get at is that oDocProp.Version. I didn't copy the whole macro into this message as it is very long.
Thanks very much.
Larry
Option Explicit
Private oFilePropReader As DSOleFile.PropertyReader
Private oDocProp As DSOleFile.DocumentProperties
Dim strPropText As String
Set oDocProp = oFilePropReader.getdocumentproperties( _
WordBasic.FileNameInfo$(.FoundFiles(iFileIndex), 1))
strPropText = oDocProp.Version