Welcome Guest!
 VB Helper Q & A
 Previous Message All Messages Next Message 
RE: Open Adobe document  Rod Stephens
 Nov 01, 2010 15:51 PST 

I think if you use ShellExecute to "execute" the pdf file, then the system will try to open it using the default application, which should be Acrobat Reader.

Try something like 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 Const SW_SHOWNORMAL = 1
Private Const SW_SHOWMAXIMIZED = 3

Private Sub cmdOpen_Click()
    ' Send this to ShellExecute.
    ShellExecute ByVal 0&, "open", "C:\test.pdf", _
        vbNullString, vbNullString, SW_SHOWMAXIMIZED
End Sub

See these examples:

http://www.vb-helper.com/howto_open_pdf_externally.html
http://www.vb-helper.com/howto_open_pdf_reader.html

HTH,

Rod

Rod Stephens
Visual Basic 2010 Programmer's Reference
http://www.vb-helper.com/vb_prog_ref.htm


   
	
 Previous Message All Messages Next Message 
  Check It Out!

  Topica Channels
 Best of Topica
 Art & Design
 Books, Movies & TV
 Developers
 Food & Drink
 Health & Fitness
 Internet
 Music
 News & Information
 Personal Finance
 Personal Technology
 Small Business
 Software
 Sports
 Travel & Leisure
 Women & Family

  Start Your Own List!
Email lists are great for debating issues or publishing your views.
Start a List Today!

© 2001 Topica Inc. TFMB
Concerned about privacy? Topica is TrustE certified.
See our Privacy Policy.