Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to load .doc,.,pdf files

Status
Not open for further replies.

johnjrd

MIS
Jun 6, 2001
54
GB
Hi

Am new here, and have a problem

We have a app which is a online Course Viewer, one feature is that it should biew documents held against the Course database.

For instance one field in the course database holds the path to a document (this could be anything from doc to pdf)

Is there a way to load the documents using the field as the file reference.

Any help would be great

thanks
 
You want to open the document using the path from the field?

You will most likely have to launch a Process that runs the viewer program (Acrobat, Word, etc.)

Look up System.Diagnostics.Process
 
Like JurkMoney said use a Process to start it like this.

WINWORD.exe takes an argument of the path to the desired file as suggests here near the bottom of this article:


So to open just pass the path as an argument into the process.

Process.Start(path_to_microsoft_word, path_to_doc);

Thats it.
 
Process.Start(path_to_microsoft_word, path_to_doc);

I believe this is actually supposed to be

Process p = new Process();

p.StartInfo.Arguments = "PATH TO FILE";

p.Start();
 
JurkMonkey

Process.Start(arg1, arg2) can take in two arguments, the exe and the arguments for the exe. I know because Ive used it like that many times.
 
I see.

I just did it in Mono not long ago but I used the StartInfo property. Same thing.

Thanks for the info!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top