Open PDF located in excel with macro
I got this code from this NG, unfortunately I did not save the authors name.
'======
Private 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
'This is the function that does the work
Public Sub OpenAcrobatFile(strFile As String)
ShellExecute 0, "open", strFile, vbNullString, vbNullString, 9
End Sub
Sub test() 'command line parameters
OpenAcrobatFile "C:\My Documents\Somefile.PDF" 'your "drive:\path\file name"
here
End Sub
'======
HTH
--
Regards
VBA.Noob.Confused
XP Pro
Office 2007
"Ken" wrote:
I have an excel model which I have made a user guide for. This userguide is a
pdf file. In my excel model I have created a commandbar with a button saying
"User guide". When I click this button I would like the User guide to open.
I have 2 questions:
1) How do I save my user guide in pdf format within the excel model, so it
can be accessed from any computer.
2) How do I get the user guide to open when I click the "User guide button"
on my commandbar.
Thanks
|