windows picture and fax viewer

Rubi

Registered User.
Local time
Today, 19:42
Joined
Jul 23, 2003
Messages
32
hi all,
i'm trying to write a code that opens a picture (link from HD) in the standard windows picture and fax viewer.
here's what i could come up with on my own:
c:\windows\system32\shimgvw.dll (i registerd it in the references)

and that's it...

i can't seem to find the right definitions and functions.
could someone please help me with the code ? i know it should be easy...

thanks alot
 
Try the following:

Create a module and add the following;

Declare Function ShellExecute Lib "shell32.dll" Alias _
"ShellExecuteA" (ByVal Hwnd As Long, ByVal lpOperation _
As String, ByVal lpFile As String, ByVal lpParameters _
As String, ByVal lpDirectory As String, ByVal nShowCmd _
As Long) As Long

Global Const SW_SHOWNORMAL = 1


Function StartDoc(DocName As String)
On Error GoTo StartDoc_Error

StartDoc = ShellExecute(Application.hWndAccessApp, "Open", DocName, _
"", "C:\", SW_SHOWNORMAL)
Exit Function

StartDoc_Error:
MsgBox "Error: " & Err & " " & Error
Exit Function
End Function
....................................................................

Then from a cmdbutton on your form:

Dim strPath As String

strPath = Me.FilePath 'Me.FilePath is the path to the file

Call StartDoc(strPath)


HTH

Dave
 

Users who are viewing this thread

Back
Top Bottom