Access/VBA/file attributes


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: Access/VBA/file attributes

  1. #1
    Nathan Guest

    Access/VBA/file attributes


    Does anyone know how to get the file attributes of an existing file or set
    them for a new one during creation (say Word or Excel, I'd settle for a .txt).
    I'm not talking about the check boxes such as "archive" or "system" but
    the ones listed in the "properties" selection when right clicking a file
    and then selecting the "summary" tab. Specifically after the "comments"
    and "Title" fields. If it matters, I do have VB6 and am running W2000Pro.

  2. #2
    Nathan Guest

    Re: Access/VBA/file attributes


    "Nathan" <nathan_veale@hotmail.com> wrote:
    >
    >Does anyone know how to get the file attributes of an existing file or set
    >them for a new one during creation (say Word or Excel, I'd settle for a

    .txt).
    > I'm not talking about the check boxes such as "archive" or "system" but
    >the ones listed in the "properties" selection when right clicking a file
    >and then selecting the "summary" tab. Specifically after the "comments"
    >and "Title" fields. If it matters, I do have VB6 and am running W2000Pro.



    Private Sub CmdTest_Click() 'imports file properties back into text boxes
    from excel workbook
    On Error GoTo Test_Err

    'Nathan

    CommDiag.ShowOpen 'standard windows open file window (via the
    common dialog ActiveX)
    strReturn = CommDiag.FileName 'returns the full path file name to the string
    variable (strReturn)

    Set ExObj = New Excel.Application
    Excel.Application.Visible = False 'the workbook isn't open long enough
    to 'paint' anyway
    Excel.Application.Workbooks.Open (strReturn)

    'putting the data into text boxes in an Access200 form
    BidDescription.SetFocus
    BidDescription.Text = Excel.Application.ActiveWorkbook.BuiltInDocumentProperties.Item("Comments")
    BidName.SetFocus
    BidName.Text = Excel.Application.ActiveWorkbook.BuiltInDocumentProperties.Item("Author")
    BidNum.SetFocus
    BidNum.Text = Excel.Application.ActiveWorkbook.BuiltInDocumentProperties.Item("Title")

    Excel.ActiveWorkbook.Close False
    Excel.Application.Quit
    Set Wobj = Nothing

    Exit Sub
    Test_Err:
    MsgBox Err.Description & vbCrLf & Err.Number

    End Sub

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center