Using DSO OLE Document Properties Reader 2.0
I can use DSO OLE Document Properties Reader 2.0 to view properties of files on a NTFS partition such as word documents, jpegs, etc. For example, with a Word 2000 document I can view the Title, Author, Comments, etc under the File Properties Tab.
How Can I change these on a file that already exists?
I am not creating the file, just tagging it with useful info.
I can create my own custom tag, such as Address: and assign a value to it, but the custom properties do not show up under file properties in Explorer. I really would like to modify the Title, Author, Comments, etc Properties.
please help...
VB Code:
'*********************************************************************
' FileProp.frm
'
' VB6 Sample code for reading file properties using DSOFILE 2.0
'
' Copyright (c)1999-2000 Microsoft Corporation, All Rights Reserved
' Microsoft Product Support Services, Developer Support
'
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
' ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED
' TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR
' A PARTICULAR PURPOSE.
'
'*********************************************************************
Option Explicit
'*********************************************************************
' FileProp Form Member Variables
'*********************************************************************
' Uses reference to "DSO OLE Document Properties Reader 2.0"
Private m_oDocumentProps As DSOFile.OleDocumentProperties
'*********************************************************************
' Form_Load -- Creates new instance of the component. Failure here
' will result in termination of the application. You need to register
' the DLL before building and running this sample!!
'*********************************************************************
Private Sub Form_Load()
' Create an instance of the DSOFile Object...
Set m_oDocumentProps = New DSOFile.OleDocumentProperties
' Fill in the default items for the DataType list...
lstCustType.AddItem "String"
lstCustType.AddItem "Long"
lstCustType.AddItem "Double"
lstCustType.AddItem "Boolean"
lstCustType.AddItem "Date"
' Show the form...
Me.Show
' Pick a file and open the properties for it,
If Not OpenDocumentProperties Then
End ' If user cancels, we exit...
End If
End Sub
'*********************************************************************
' Form_Unload -- Closes the dialog and prompts user to save (if dirty).
'*********************************************************************
Re: Using DSO OLE Document Properties Reader 2.0
VB Code:
Dim oSummProps As DSOFile.SummaryProperties
'On Error Resume Next
Set oSummProps = m_oDocumentProps.SummaryProperties
If (txtAuthor.Text <> oSummProps.Author) Then
oSummProps.Author = txtAuthor.Text
End If
Pretty easy to set values, depending on the file type. Word Docuent no problem. I can do it on some jpeg's, but not others... and no bitmap or gif files.
I get:
run-time error '-21474891 (80070005)'