Results 1 to 7 of 7
  1. #1
    Silver Lounger
    Join Date
    Jun 2002
    Location
    Cheadle, Staffordshire
    Posts
    2,177
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Common Dialog (A2000)

    Does any one know of a common dialog control which will preview images in a given directory.

    I need the user to select a jpg from a folder, but if there are numerous images, the user needs to see a preview before selecting.

    Dave

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Common Dialog (A2000)

    Perhaps somebody else can point out third-party dialog controls. A quick Google didn't yield much for VBA.

    Just a wild idea: you can automate Word from Access. The Word open dialog box has a preview option and can display many types of graphics files, including jpg. If us use the Display method of the open dialog box, Word won't actually open the file, but you can use the selected file name in Access.

    Something like:

    Dim appWord As New Word.Application
    Dim strFile As String
    appWord.ChangeFileOpenDirectory "C:MyFolder"
    With appWord.Dialogs(wdDialogFileOpen)
    .Name = "*.jpg"
    If .Display = -1 Then
    strFile = .Name
    End If
    End With
    appWord.Quit SaveChanges:=wdDoNotSavechanges
    Set appWord = Nothing

    You need a reference to the Microsoft Word 9.0 Object Library for this to work.

    Another idea would be to create a custom form for previewing jpg files.

  3. #3
    Silver Lounger
    Join Date
    Jun 2002
    Location
    Cheadle, Staffordshire
    Posts
    2,177
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Common Dialog (A2000)

    Perhaps the custom form is the better option for me, not sure what would happen on a run-time if word wasn't on the pc.

    Any directions in creating this form would be appreciated.
    I do not store the images via OLE only the path.

    Dave

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Common Dialog (A2000)

    Hi Dave,

    Just a few remarks on creating a custom preview form:
    1. <LI>Put a list box on the form and populate it with the file names of .jpg files in a folder.
      You can do this with a callback function (do a search or ask) or by creating a list of values in the OnLoad or OnOpen event of the form.
      <LI>Put an unbound image control on the form.
      <LI>In the OnClick event of the list box, set the Picture property of the image control to the file name selected in the list box.
    I hope this will give you a rough idea.

    Regards,
    Hans

  5. #5
    Silver Lounger
    Join Date
    Jun 2002
    Location
    Cheadle, Staffordshire
    Posts
    2,177
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Common Dialog (A2000)

    Hans
    I've searched and none of the examples really meet my needs.
    Not heard of the callback function before.

    My Images are located on L:Home???.jpg

    Could you explain a little more in depth.

    Dave

  6. #6
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Common Dialog (A2000)

    You can find samples of callback functions in on-line help (yes, even in Access 2000 on-line help). What do you need help with, using the image control or building a callback? Here's a link to a post on using a callback to populate a combobox with a list of dates. There's an Access 97 sample database attached to this post that might give you some ideas about using the image control.
    Charlotte

  7. #7
    Silver Lounger
    Join Date
    Jun 2002
    Location
    Cheadle, Staffordshire
    Posts
    2,177
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Common Dialog (A2000)

    Thanks all for the help, I found this ( directed from world forums) ( Thanks cpod ) but haven't tried it yet.
    I'll let you know how things go.

    Dave


    http://www.wopr.com/cgi-bin/w3t/showflat.p...;o=0&fpart=

    Edited by Charlotte to activate link

Posting Permissions

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