473,402 Members | 2,046 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,402 software developers and data experts.

opening a document with system's default app

Hy, I need to open files by clicking a open button in a form.
Files would be in any format and I want to open them with system's asociated
aplication.
Thanks for your atention.
May 26 '06 #1
3 851
Rubén Cuenca wrote:
Hy, I need to open files by clicking a open button in a form.
Files would be in any format and I want to open them with system's
asociated aplication.


Use the UseShellExecute property of a Process object, it'll launch a file
with whatever application is registered as the default viewer. For example,
to open a PDF file:

\\\
Dim proc As New Process
'Set the process details
With proc.StartInfo
'Set the information for the file to launch
.FileName = "C:\YourPDFFile.pdf"
.UseShellExecute = True
End With
'Open the file
proc.Start()
///

--

(O)enone
May 26 '06 #2
Ruben,

Open a document means nothing, a document can be everything. It is a file,
but it can be a part of a WebPage, a doc file from Word, a part of a table
in a database etc. etc.

Can you explain a little bit more what you want?

Cor

"Rubén Cuenca" <el*****@hotmail.com> schreef in bericht
news:ef**************@TK2MSFTNGP03.phx.gbl...
Hy, I need to open files by clicking a open button in a form.
Files would be in any format and I want to open them with system's
asociated
aplication.
Thanks for your atention.

May 26 '06 #3
"Rubén Cuenca" <el*****@hotmail.com> schrieb:
Hy, I need to open files by clicking a open button in a form.
Files would be in any format and I want to open them with system's
asociated
aplication.

\\\
Imports System.Diagnostics
....
Process.Start("C:\foo.doc")
///

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

May 26 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

14
by: D. Alvarado | last post by:
Hello, I am trying to open a window containing an image and I would like the image to be flush against the window -- i.e. have no padding or border. Can I make this happen with a single call to a...
4
by: Yohancef Chin | last post by:
Hi, Being fairly new to .NET I am looking for a way to call MS Word from an event on a webform, and after the user is finished save that created document to an SQL Server database. Has anyone...
3
by: Yohancef Chin | last post by:
Hi, Being fairly new to .NET I am looking for a way to call MS Word from an event on a webform, and after the user is finished save that created document to an SQL Server database. Has anyone...
4
by: Charlie Brookhart | last post by:
I am trying to write a code for a button click event. When the button is clicked, it is supposed to bring up an open file dialog box to allow the user to select the document they which to open....
5
by: Cedric | last post by:
Hi Folks, I'm wondering if someone has already succeed to open a word2000 document located on server side with javascript code executed by a web browser on client side. In fact, i make it...
26
by: Nospam | last post by:
I am trying to open a link in a new template window : <a onclick="windowopen('example.html','example');return false;" href="http://www.example.com" target="_blank"example link</a> such that...
0
by: =?Utf-8?B?V2FubmFiZQ==?= | last post by:
I am creating a webpage and opening it as a Word document. Problem is that as I create one of the questions, some of the text is not appearing in the document as it should. As I step through it, I...
10
by: Simon Brooke | last post by:
The DOM API has included public Node importNode(Node,boolean) as a method of the Document interface for a long time. Does anything actually implement it? Xerces 2 is giving me: ...
3
by: =?Utf-8?B?TGllbGE=?= | last post by:
I have a user who stores her documents on a different drive and when she attempts to open documents it auto defaults to My Documents instead of her other drive. Is there a way to change the...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.