Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Open Documents of Arbitrary Type from .Net

6 views
Skip to first unread message

Chris Newby

unread,
Feb 21, 2006, 10:47:00 AM2/21/06
to
I'm developing a win form based add-on to a document management system using
the .Net runtime. When a user is using my add-on they could be dealing with
documents of many different types, e.g. Word, PDF, Excel, RTF. I would like
to add a "View" button to my add-on that will open whatever document they
are currently handleing with that document's associated application.

I'm not trying to control the document after that point; I simply want to
launch the associated application and forget about it.

What's the best way? Any thoughts?

TIA//

Tim Wilson UNDERSCORE AT PERIOD

unread,
Feb 21, 2006, 11:03:05 AM2/21/06
to
See the information at the link below.
http://dotnet.mvps.org/dotnet/faqs/?id=openfileappwebpage&lang=en

--
Tim Wilson
.NET Compact Framework MVP

"Chris Newby" <Chris...@Rockcreekglobal.com> wrote in message
news:uBpOP4vN...@tk2msftngp13.phx.gbl...

Bob Powell [MVP]

unread,
Feb 21, 2006, 11:04:13 AM2/21/06
to
If you use the process class to run the file that you're interested in such
as "MyPDF.PDF" the normal file associations will kick in and display the
file in whatever program is assigned to that file.

I've also created viewers before that launch the associated program inside
the IE browser control. This is a good container.

--
Bob Powell [MVP]
Visual C#, System.Drawing

Ramuseco Limited .NET consulting
http://www.ramuseco.com

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.

"Chris Newby" <Chris...@Rockcreekglobal.com> wrote in message
news:uBpOP4vN...@tk2msftngp13.phx.gbl...

George Shubin

unread,
Feb 21, 2006, 11:09:23 AM2/21/06
to
Dim p As New System.Diagnostics.Process
With p
.StartInfo.RedirectStandardOutput = False
.StartInfo.FileName = YourFileName
.StartInfo.UseShellExecute = True
.Start()
.Dispose()
End With

--
------------------------------------------------------------------------
George Shubin Custom Software Development
dX Software Systems Database Applications
Ph: 503-981-6806 Fax: 503-982-0120
www.dxonline.com geo...@dxonline.com
------------------------------------------------------------------------

"There never was a bad man who had ability for good service." -- Edmund
Burke

"Chris Newby" <Chris...@Rockcreekglobal.com> wrote in message
news:uBpOP4vN...@tk2msftngp13.phx.gbl...

Chris Newby

unread,
Feb 21, 2006, 11:26:20 AM2/21/06
to
Awesome ...

Yeah ... I was trying the process class, but was having problems and wasn't
sure it was the right way to go. I'll try it again tho//

Thanks everyone!

"Chris Newby" <Chris...@Rockcreekglobal.com> wrote in message
news:uBpOP4vN...@tk2msftngp13.phx.gbl...

0 new messages