Opening a WinWord or Powerpoint Doc

  • Thread starter Thread starter Alex
  • Start date Start date
A

Alex

Dear colleagues

Is there a better command in VB.NET then ShellExecute to open from the
VB.NET code directly a Word or Powepoint document? The function should
automatically open depending of the file extension the appropriate program.
e.g. *.doc should be opened with Word etc.

Thank Alex
 
Alex,

The commands for that can be by instance the ones beneath, however more
with the process or processstartInfo class

I hope this helps?

Cor

\\\
Dim p As New Process
p.StartInfo.UseShellExecute = True
p.StartInfo.FileName = "c:\mydoc.doc"
p.Start()
\\\
\\\
Dim p As New System.Diagnostics.ProcessStartInfo()
p.WindowStyle = ProcessWindowStyle.Hidden
p.FileName = "C:\mydoc.doc"
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

Back
Top