Results 1 to 4 of 4
  1. #1
    New Lounger
    Join Date
    Sep 2007
    Location
    Bayamon, Puerto Rico, USA
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Opening a file (2003)

    I have a field that store the path of a file, example Image filed store sdm-vault1imagefile.gif
    In a form I want to open that file doing a click. Is this possible?

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

    Re: Opening a file (2003)

    You can put a command button on a form bound to the table, and put code like the following in the On Click event of the command button:

    Private Sub cmdOpen_Click()
    If Not IsNull(Me.txtPath) Then
    Application.FollowHyperlink Me.txtPath
    End If
    End Sub

    where cmdOpen is the name of the command button and txtPath is the name of the field, or of a text box bound to the field. The code will open the file in the application associated with the file type.

  3. #3
    New Lounger
    Join Date
    Sep 2007
    Location
    Bayamon, Puerto Rico, USA
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Opening a file (2003)

    Ok, it work but open the gif with Internet Explorer. Is possible open the file using Windows Picture and Fax viewer?

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

    Re: Opening a file (2003)

    If you want .gif files to always open in Windows Picture and Fax Viewer:
    - Start Windows Explorer.
    - Locate a .gif file.
    - Right-click it, and select Open With > Choose Program... from the popup menu.
    - Select Windows Picture and Fax Viewer in the list of programs.
    - Tick the check box "Always use the selected program to open this kind of file".
    - Click OK.

    If you only want to open .gif files in Windows Picture and Fax Viewer from your database, use the following instruction in the On Click event procedure of the command button:
    <code>
    Shell "rundll32.exe C:WINDOWSSystem32shimgvw.dll,ImageView_Fullscreen " & Chr(34) & Me.txtPath & Chr(34)
    </code>
    instead of the line with Application.FollowHyperink.

Posting Permissions

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