Results 1 to 3 of 3

Thread: Launch a pdf file from vb program

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Jul 2002
    Location
    Australia
    Posts
    635

    Launch a pdf file from vb program

    What is the eaisest way to launch a .pdf file from a VB program?
    A.A. Fussy
    Babya Software Group

  2. #2
    -= B u g S l a y e r =- peet's Avatar
    Join Date
    Aug 2000
    Posts
    9,629
    using ShellExecute I think
    -= a peet post =-

  3. #3
    -= B u g S l a y e r =- peet's Avatar
    Join Date
    Aug 2000
    Posts
    9,629
    VB Code:
    1. Option Explicit
    2.  
    3.  
    4. Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" _
    5.                 (ByVal hwnd As Long, ByVal lpszOp As String, _
    6.                  ByVal lpszFile As String, ByVal lpszParams As String, _
    7.                  ByVal LpszDir As String, ByVal FsShowCmd As Long) _
    8.                  As Long
    9.  
    10.  
    11. Private Sub Command2_Click()
    12.     'Open a document
    13.     Dim l As Long
    14.     l = ShellExecute(Me.hwnd, "Open", App.Path & "\Test.pdf", "", "C:\", vbNormalFocus)
    15. End Sub
    -= a peet post =-

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width