File Custom properties

  • Thread starter Thread starter Fred
  • Start date Start date
F

Fred

Hi,
I want to be able to read and write to the custom properties of any Office
type file. In Windows explorer I can do this manually by right clicking on a
file selecting 'properties' from the popup menu and clicking the custom tab.
This allows me to read and edit custom properties without opening the file.
Can this be done using VB. Does anyone have an example of this.

Thanks
Fred
 
I want to be able to read and write to the custom properties of any
Office type file. In Windows explorer I can do this manually by right
clicking on a file selecting 'properties' from the popup menu and
clicking the custom tab. This allows me to read and edit custom
properties without opening the file. Can this be done using VB. Does
anyone have an example of this.

..NET OLE Structured Storage Classes
http://www.mvps.org/emorcillo/cod/net.htm
 
Eduardo,
thanks for the info but how do I use it. I run the 'net_storage.msi' and it
seemed to install but what are the classes and what namespace.

Regards,
Fred

Eduardo A. Morcillo said:
I want to be able to read and write to the custom properties of any
Office type file. In Windows explorer I can do this manually by right
clicking on a file selecting 'properties' from the popup menu and
clicking the custom tab. This allows me to read and edit custom
properties without opening the file. Can this be done using VB. Does
anyone have an example of this.

..NET OLE Structured Storage Classes
http://www.mvps.org/emorcillo/cod/net.htm
 
Eduardo,
thanks for the info but how do I use it. I run the 'net_storage.msi'
and it seemed to install but what are the classes and what namespace.

First add the dll reference (It's listed as "Edanmo's OLE Storage Classes"). Then import the Edanmo.OleStorage namespace to use the class. If you want to read properties from a file use the following code:

Dim file As Storage
Dim propset As PropertySetStorage
Dim propstg As PropertyStorage

' Open the file
file = New Storage("c:\unpak\test.doc")

' Get the property set storage.
propset = file.PropertySetStorage

' Properties are grouped in sets. There're 3 predefined
' sets: SummaryInformation, DocSummaryInformation and
' UserProperties.
' In this case we open the summary information storage
propstg = propset.Open(propset.FMTID_SummaryInformation)

' Read the file author
MsgBox("Author: " & propstg.Item(PropertyStorage.SummaryProperty.Author))

' Close all
propstg.Close()
propset.Close()
file.Close()

BTW, there's a sample in the msi package that shows the use of the dll.
 
Back
Top