arenna

viewing .pdf file with command button

Discussion created by arenna on Apr 29, 2011
Latest reply on Apr 29, 2011 by jamesfreddyc
I want to add some Help buttons to a user form that will pull up a .PDF or .HTML file that the User can use to learn how to use the form correctly.

i used the code below but get an error says "Only comments may appear after End Sub, End function or End property" . how do I fix this?

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

Private Sub help_Click()
    Dim strFileToOpen As String
    strFileToOpen = "helpfiletoolbox.pdf"
    Dim strFolder As String
    strFolder = "h:\"
   
    Call ShellExecute(0, vbNullString, strFileToOpen, vbNullString, strFolder, 1)
End Sub

Outcomes