Shell a program and run a document

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?
 
G

Guest

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
 
R

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?

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
 
H

Herfried K. Wagner [MVP]

* "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)
///
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top