dcsimg


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: Edit Access file properties

  1. #1
    Keiron Guest

    Edit Access file properties


    Hi there,

    I'm creating a program which will amend the details which are displayed when
    your in explorer,
    1. right click on any MS Office then select
    2. properties >
    3. summary and then add text to the comments.

    Now I've been able to do this for Word,Excel and Powerpoint however Access
    seems to use a completely different format for accessing this property.

    I've been experimenting with the following code with the hope to append the
    comments property to the available list, but to little or no avail!

    Dim wrkMain As Workspace
    Dim dbsPubs As Database
    Dim prpLoop As Property

    ' Create Microsoft Jet Workspace object.
    Set wrkMain = CreateWorkspace("", "admin", "", dbUseJet)

    ' Open a Database object based on information in
    ' the connect string.
    Set dbsPubs = wrkMain.OpenDatabase(strapppathname)

    ' Enumerate the Properties collection of the Database
    ' object.
    With dbsPubs
    Debug.Print "Database properties for " & _
    .Name & ":"

    On Error Resume Next
    For Each prpLoop In .Properties
    If prpLoop.Name = "Connection" Then
    ' Property actually returns a Connection object.
    Debug.Print " Connection[.Name] = " & _
    .Connection.Name
    Else
    Debug.Print " " & prpLoop.Name & " = " & _
    prpLoop
    End If
    Next prpLoop
    On Error GoTo 0

    End With

    dbsPubs.Close
    wrkMain.Close

    Any help would be greatly appreciated as I've only been a coder for 2 months!!!

    Many Thanks in Advance

    Keiron

    -------------------------
    Keiron S McDonnell
    UK-IS Infrastructure
    Perkins Engines Ltd.
    Peterborough, PE1 5NA
    Tel +44 (1733) 58[3103]
    -------------------------

  2. #2
    Keiron Guest

    Re: Edit Access file properties


    Sorry pasted wrong sample code ;-)

    Dim WrkMain2 As Workspace
    Dim dbspubs2 As Database
    Dim PrpAccess As Property

    Set WrkMain2 = CreateWorkspace("", "admin", "", dbUseJet)

    Set dbspubs2 = WrkMain2.OpenDatabase(strapppathname)

    Set PrpAccess = dbspubs2.CreateProperty("Comment", dbText, "Cat Unclassified
    Data")


    dbspubs2.Properties.Append Comment

    SetProperty dbspubs2, Comment, True

    PrpAccess.Properties(Comment) = CatClassification

    dbspubs2.Close
    WrkMain2.Close

    Cheers

    Keiron

    "Keiron" <mcdonks@perkins.com> wrote:
    >
    >Hi there,
    >
    >I'm creating a program which will amend the details which are displayed

    when
    >your in explorer,
    >1. right click on any MS Office then select
    >2. properties >
    >3. summary and then add text to the comments.
    >
    >Now I've been able to do this for Word,Excel and Powerpoint however Access
    >seems to use a completely different format for accessing this property.
    >
    >I've been experimenting with the following code with the hope to append

    the
    >comments property to the available list, but to little or no avail!
    >
    > Dim wrkMain As Workspace
    > Dim dbsPubs As Database
    > Dim prpLoop As Property
    >
    > ' Create Microsoft Jet Workspace object.
    > Set wrkMain = CreateWorkspace("", "admin", "", dbUseJet)
    >
    > ' Open a Database object based on information in
    > ' the connect string.
    > Set dbsPubs = wrkMain.OpenDatabase(strapppathname)
    >
    > ' Enumerate the Properties collection of the Database
    > ' object.
    > With dbsPubs
    > Debug.Print "Database properties for " & _
    > .Name & ":"
    >
    > On Error Resume Next
    > For Each prpLoop In .Properties
    > If prpLoop.Name = "Connection" Then
    > ' Property actually returns a Connection object.
    > Debug.Print " Connection[.Name] = " & _
    > .Connection.Name
    > Else
    > Debug.Print " " & prpLoop.Name & " = " & _
    > prpLoop
    > End If
    > Next prpLoop
    > On Error GoTo 0
    >
    > End With
    >
    > dbsPubs.Close
    > wrkMain.Close
    >
    >Any help would be greatly appreciated as I've only been a coder for 2 months!!!
    >
    >Many Thanks in Advance
    >
    >Keiron
    >
    >-------------------------
    >Keiron S McDonnell
    >UK-IS Infrastructure
    >Perkins Engines Ltd.
    >Peterborough, PE1 5NA
    >Tel +44 (1733) 58[3103]
    >-------------------------



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