Update File | Summary | Attributes

Discussion in 'ASP General' started by Michael Reynolds, Oct 11, 2005.

  1. I can read file attributes just fine (author, title, etc,)

    But there's no way to update them. I know windows application can do it,
    but can a web application update these files?

    Here's the code I'm using:

    Dim oSummProps As DSOFile.SummaryProperties

    Dim oCustProp As DSOFile.CustomProperty

    Dim sFile, sTmp As String

    Dim m_oDocument As DSOFile.OleDocumentPropertiesClass



    m_oDocument = New DSOFile.OleDocumentPropertiesClass

    ' Note: fileName is just a local file...in this case, c:\test.txt.

    m_oDocument.Open(fileName, False, _

    DSOFile.dsoFileOpenOptions.dsoOptionOpenReadOnlyIfNoWriteAccess)



    If Not m_oDocument.IsReadOnly Then

    oSummProps = m_oDocument.SummaryProperties

    oSummProps.Title = myNewTitle

    m_oDocument.Save()

    End If

    m_oDocument.Close()

    m_oDocument = Nothing
     
    Michael Reynolds, Oct 11, 2005
    #1
    1. Advertising

  2. Michael Reynolds wrote:
    > I can read file attributes just fine (author, title, etc,)
    >
    > But there's no way to update them. I know windows application can do
    > it, but can a web application update these files?
    >
    > Here's the code I'm using:
    >
    > Dim oSummProps As DSOFile.SummaryProperties
    >

    Hmm, this does not look like vbscript, so I can only assume it is vb.net, in
    which case:

    There was no way for you to know it, but this is a classic asp newsgroup.
    While you may be lucky enough to find a dotnet-knowledgeable person here who
    can answer your question, you can eliminate the luck factor by posting your
    question to a group where those dotnet-knowledgeable people hang out. I
    suggest microsoft.public.dotnet.framework.aspnet.

    As for your question, I would suggest reading the documentation for the
    DSOFile class. If that does not help, post to the dotnet newsgroup.

    Bob Barrows
    --
    Microsoft MVP - ASP/ASP.NET
    Please reply to the newsgroup. This email account is my spam trap so I
    don't check it very often. If you must reply off-line, then remove the
    "NO SPAM"
     
    Bob Barrows [MVP], Oct 12, 2005
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Max
    Replies:
    1
    Views:
    498
    Joe Kesselman
    Sep 22, 2006
  2. P4trykx
    Replies:
    2
    Views:
    1,846
    bruce barker
    Jan 31, 2007
  3. james_027

    class attributes & data attributes

    james_027, Jun 20, 2007, in forum: Python
    Replies:
    2
    Views:
    385
    Bruno Desthuilliers
    Jun 20, 2007
  4. Kyle Schmitt
    Replies:
    3
    Views:
    202
    Kyle Schmitt
    Jul 24, 2007
  5. Jayden
    Replies:
    16
    Views:
    540
    Steven D'Aprano
    Sep 29, 2012
Loading...

Share This Page