Shell a program and run a document

  • Thread starter Thread starter Tom McLaughlin
  • Start date Start date
T

Tom McLaughlin

I need to start Acrobat reader and load the file guide.pdf
The following code will start the program but how do I get
it to load my document guide.pdf?

Shell("C:\Program Files\Adobe\Acrobat 6.0\Reader\AcRord32.exe ")

The code above I spell out where Acrobat reader is, I there a way to find it
and load my file from a application path?
 
Hi Tom, not sure if this will help but if you don't have to use shell you could use

System.Diagnostics.Process.Start("Your.pdf"

And that will launch the pdf you specified in the default application (Adobe Acrobat Reader)

Regards, Synthanato

----- Tom McLaughlin wrote: ----

I need to start Acrobat reader and load the file guide.pd
The following code will start the program but how do I ge
it to load my document guide.pdf

Shell("C:\Program Files\Adobe\Acrobat 6.0\Reader\AcRord32.exe "

The code above I spell out where Acrobat reader is, I there a way to find i
and load my file from a application path
 
Tom McLaughlin said:
I need to start Acrobat reader and load the file guide.pdf
The following code will start the program but how do I get
it to load my document guide.pdf?

Shell("C:\Program Files\Adobe\Acrobat 6.0\Reader\AcRord32.exe ")

The code above I spell out where Acrobat reader is, I there a way to find it
and load my file from a application path?

Check out the Process class in the System.DIAGNOSTICS namespace.

Process.Start("pathtoyourfile.pdf")

Will automatically load your file into the application registered to
handle files of that type with the OS, in this case good old
AcrobatReader.

Hth

Richard
 
* "Tom McLaughlin said:
I need to start Acrobat reader and load the file guide.pdf
The following code will start the program but how do I get
it to load my document guide.pdf?

Shell("C:\Program Files\Adobe\Acrobat 6.0\Reader\AcRord32.exe ")

The code above I spell out where Acrobat reader is, I there a way to find it
and load my file from a application path?

\\\
Dim p As New System.Diagnostics.ProcessStartInfo()
p.FileName = "C:\filename.pdf"
p.UseShellExecute = True
System.Diagnostics.Process.Start(p)
///
 
Back
Top