Link to home
Start Free TrialLog in
Avatar of btgtech
btgtechFlag for United States of America

asked on

Launching Hyperlinks from Microsoft Access

We have an Access Application where we are saving hyperlinks to documents.  For tif, jpg, etc documents, the hyperlinks are opening up to a viewer.  We would like to have these files open up in MS Paint.

Is there a way to code this into the application?
Avatar of omgang
omgang
Flag of United States of America image

Tested in Access 2007 on Windows 7
OM Gang

Public Function TestShell()
On Error GoTo Err_TestShell

    Dim varReturn

    varReturn = Shell("c:\Windows\system32\mspaint.exe f:\temp\outlookfind1.jpg", vbNormalFocus)

Exit_TestShell:
    Exit Function

Err_TestShell:
    MsgBox Err.Number & " (" & Err.Description & ") in procedure TestShell of Module Module3"
    Resume Exit_TestShell
   
End Function
Avatar of btgtech

ASKER

Does anything need to change in the hyperlink?
ASKER CERTIFIED SOLUTION
Avatar of omgang
omgang
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
It may help to post the current code/macro/event procedure for how the hyperlinks are being opened now.
OM Gang
Avatar of btgtech

ASKER

The App currently uses the functionality available when a field type of Hyperlink is used.
So what value is stored in the field?  Just the file name or a UNC path as in my example?
OM Gang
Avatar of btgtech

ASKER

It is the UNC path, so I will try the above Function.