Results 1 to 2 of 2

Thread: Using DSO OLE Document Properties Reader 2.0

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 2002
    Posts
    352

    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:
    1. '*********************************************************************
    2. ' FileProp.frm
    3. '
    4. ' VB6 Sample code for reading file properties using DSOFILE 2.0
    5. '
    6. '  Copyright (c)1999-2000 Microsoft Corporation, All Rights Reserved
    7. '  Microsoft Product Support Services, Developer Support
    8. '
    9. '  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
    10. '  ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED
    11. '  TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR
    12. '  A PARTICULAR PURPOSE.
    13. '
    14. '*********************************************************************
    15. Option Explicit
    16.  
    17. '*********************************************************************
    18. ' FileProp Form Member Variables
    19. '*********************************************************************
    20. ' Uses reference to "DSO OLE Document Properties Reader 2.0"
    21. Private m_oDocumentProps As DSOFile.OleDocumentProperties
    22.  
    23. '*********************************************************************
    24. ' Form_Load  -- Creates new instance of the component. Failure here
    25. '   will result in termination of the application. You need to register
    26. '   the DLL before building and running this sample!!
    27. '*********************************************************************
    28. Private Sub Form_Load()
    29.  
    30.  ' Create an instance of the DSOFile Object...
    31.    Set m_oDocumentProps = New DSOFile.OleDocumentProperties
    32.      
    33.  ' Fill in the default items for the DataType list...
    34.    lstCustType.AddItem "String"
    35.    lstCustType.AddItem "Long"
    36.    lstCustType.AddItem "Double"
    37.    lstCustType.AddItem "Boolean"
    38.    lstCustType.AddItem "Date"
    39.  
    40.  ' Show the form...
    41.    Me.Show
    42.      
    43.  ' Pick a file and open the properties for it,
    44.    If Not OpenDocumentProperties Then
    45.       End ' If user cancels, we exit...
    46.    End If
    47.    
    48. End Sub
    49.  
    50. '*********************************************************************
    51. ' Form_Unload  -- Closes the dialog and prompts user to save (if dirty).
    52. '*********************************************************************

  2. #2

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 2002
    Posts
    352

    Re: Using DSO OLE Document Properties Reader 2.0

    VB Code:
    1. Dim oSummProps As DSOFile.SummaryProperties
    2.    'On Error Resume Next
    3.    Set oSummProps = m_oDocumentProps.SummaryProperties
    4.    If (txtAuthor.Text <> oSummProps.Author) Then
    5.       oSummProps.Author = txtAuthor.Text
    6.    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)'

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width