First of all why are you doing this:
Shell app.path & "\book.pdf", vbnormalfocus
book.pdf is a file, not an application. You need to Shell an application
You need to do something like this:
Code: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 Command1_Click() ShellExecute 0, "open", App.Path & "\book.pdf", 0, 0, 1 End Sub




Reply With Quote