Home All Groups Group Topic Archive Search About

How to open (view/edit) files programmatically?

Author
4 May 2007 5:44 PM
Bill Nguyen
I would like to open for view only or editing different file types in
VB.NEt.
For example:
PDF
BMP
JPEG
GIF
DOC
etc...

Can use file association in Windows OS or to detect necessary application
based on file extension then invoke it.

Thanks

Bill

Author
5 May 2007 11:24 AM
G Himangi
To open a file with its associated app, you could use the following function
:

void ShellExecute(string cmd)
{
ProcessStartInfo pi = new ProcessStartInfo(cmd);
pi.UseShellExecute = true;
pi.Verb = "open";
System.Diagnostics.Process.Start(pi);
}

---------
- G Himangi,   Sky Software       http://www.ssware.com
Shell MegaPack : GUI Controls For Drop-In Windows Explorer like Shell
Browsing Functionality For Your App (.Net & ActiveX Editions).
EZNamespaceExtensions.Net : Develop namespace extensions rapidly in .Net
EZShellExtensions.Net : Develop all shell extensions,explorer bars and BHOs
rapidly in .Net
---------



Show quoteHide quote
"Bill Nguyen" <billn_nospam_please@jaco.com> wrote in message
news:uBtvbPnjHHA.3960@TK2MSFTNGP02.phx.gbl...
>I would like to open for view only or editing different file types in
>VB.NEt.
> For example:
> PDF
> BMP
> JPEG
> GIF
> DOC
> etc...
>
> Can use file association in Windows OS or to detect necessary application
> based on file extension then invoke it.
>
> Thanks
>
> Bill
>
>