I am making a CD for the non-profit organization I work for. The CD contains
all of the publications that we publish and will contain a GUI to access
them. When the user clicks on a publication button in the GUI, the pdf of the
publication needs to open in an Adobe Reader/Acrobat window. I can't figure
out how to make this work in VB.
I was told to try this:
[color=blue]
>You'd want to use ShellExecute, as shown on
>http://vb.mvps.org/samples/hyperjmp...
>
> Private Declare Function ShellExecute Lib "shell32.dl l" 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
>
> Public Function OpenDoc(ByVal DocFile As String) As Long
> ' Actually uses the default verb if available, and "open" otherwise
> OpenDoc = ShellExecute(0& , vbNullString, DocFile, vbNullString,
>vbNullString , vbNormalFocus)
> End Function
>
>Pass the path/name of the desired PDF to this OpenDoc function.[/color]
I've tried that, but now my problem is I've been messing around with
ShellExecute for awhile and I'm having issues.
I don't think I'm passing the path/name of the PDF to the OpenDoc function
correctly. If I have a button named 'PDF', that calls the OpenDoc function
and passes the path/filename to it when it's clicked, what would the function
call look like?
Thanks for any help.
all of the publications that we publish and will contain a GUI to access
them. When the user clicks on a publication button in the GUI, the pdf of the
publication needs to open in an Adobe Reader/Acrobat window. I can't figure
out how to make this work in VB.
I was told to try this:
[color=blue]
>You'd want to use ShellExecute, as shown on
>http://vb.mvps.org/samples/hyperjmp...
>
> Private Declare Function ShellExecute Lib "shell32.dl l" 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
>
> Public Function OpenDoc(ByVal DocFile As String) As Long
> ' Actually uses the default verb if available, and "open" otherwise
> OpenDoc = ShellExecute(0& , vbNullString, DocFile, vbNullString,
>vbNullString , vbNormalFocus)
> End Function
>
>Pass the path/name of the desired PDF to this OpenDoc function.[/color]
I've tried that, but now my problem is I've been messing around with
ShellExecute for awhile and I'm having issues.
I don't think I'm passing the path/name of the PDF to the OpenDoc function
correctly. If I have a button named 'PDF', that calls the OpenDoc function
and passes the path/filename to it when it's clicked, what would the function
call look like?
Thanks for any help.
Comment