Opening an existing file on my PC

  • Thread starter Thread starter LB
  • Start date Start date
L

LB

I have one form that has two buttons. I want the first button to exit the
form, and the second button to open a specific file on my C: drive.

I can get the form to close (Woo!), but can anybody tell me the code needed
to open an existing file on my computer. I've spent all morning looking on
the net but have had no luck.

The file, if it makes any difference, is a .pps

Thanks in advance people.

Luke
 
Hi Luke,

Can you try this one

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

Cor
 
Try using the System.IO.StreamReader class
dim sr as System.IO.Streamreader
sr = new System.IO.StreamReader("theFileName.pps")

assuming you want to read the file
 

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

Back
Top