473,698 Members | 2,574 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Open file with associated app

Hi,

I can probably use "Shell" function to open an app with a switch to open a
selected file.

But is it possible to read the application that a file type has been
associated with to determine which application name to pass to the "Shell"
function?

I am trying to emulate the user double clicking on a file selected in
Explorer.
My VB.Net does not know which file or file type will be selected.

Or is there another approach.

Thanks

Doug
Nov 21 '05 #1
4 3126
Hi,

If you use process.start(" YourFile") it will open it up in the
program associated with that file extension.

Ken
--------------------
"Doug Bell" <Po*********@vo daphone.com.au> wrote in message
news:eI******** *****@TK2MSFTNG P12.phx.gbl...
Hi,

I can probably use "Shell" function to open an app with a switch to open a
selected file.

But is it possible to read the application that a file type has been
associated with to determine which application name to pass to the "Shell"
function?

I am trying to emulate the user double clicking on a file selected in
Explorer.
My VB.Net does not know which file or file type will be selected.

Or is there another approach.

Thanks

Doug

Nov 21 '05 #2
"Doug Bell" <Po*********@vo daphone.com.au> schrieb:
But is it possible to read the application that a file type has been
associated with to determine which application name to pass to the "Shell"
function?


Opening files, applications, Web documents, and the mail client
<URL:http://dotnet.mvps.org/dotnet/faqs/?id=openfileapp webpage&lang=en >

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

Nov 21 '05 #3
Thanks Herfried

"Herfried K. Wagner [MVP]" <hi************ ***@gmx.at> wrote in message
news:eJ******** ******@TK2MSFTN GP14.phx.gbl...
"Doug Bell" <Po*********@vo daphone.com.au> schrieb:
But is it possible to read the application that a file type has been
associated with to determine which application name to pass to the "Shell" function?


Opening files, applications, Web documents, and the mail client
<URL:http://dotnet.mvps.org/dotnet/faqs/?id=openfileapp webpage&lang=en >

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

Nov 21 '05 #4
Thanks Ken
"Ken Tucker [MVP]" <vb***@bellsout h.net> wrote in message
news:%2******** ********@TK2MSF TNGP15.phx.gbl. ..
Hi,

If you use process.start(" YourFile") it will open it up in the
program associated with that file extension.

Ken
--------------------
"Doug Bell" <Po*********@vo daphone.com.au> wrote in message
news:eI******** *****@TK2MSFTNG P12.phx.gbl...
Hi,

I can probably use "Shell" function to open an app with a switch to open a selected file.

But is it possible to read the application that a file type has been
associated with to determine which application name to pass to the "Shell" function?

I am trying to emulate the user double clicking on a file selected in
Explorer.
My VB.Net does not know which file or file type will be selected.

Or is there another approach.

Thanks

Doug


Nov 21 '05 #5

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

Similar topics

5
1654
by: deko | last post by:
I use hyperlinks in a subform datasheet to display locally saved documents that are associated with individual database entries. A customer entry may have a list of invoices in pdf format, for example: invoice23.pdf invoice24.pdf The document name appears as a hyperlink in the datasheet. The document is opened (by the associated application) when the hyperlink is clicked. The problem is the database and all the documents are stored...
2
4172
by: Sin | last post by:
Hello everyone, I'm totally stumped at how little info I can find in MSDN or on the web concerning this. It's almost as if only microsoft personel hold the key to these secrets or something!!! I'm currently writting a program in which there is a file/folder list which mimics part of Explorer's list. I've got it pretty much cornered, but I still have a couple of problems :
2
1487
by: Michael Sutherland | last post by:
I'm attempting to use a Hyperlink within a database to open an outside Acrobat or Word file. I've placed the path into the database, and I've accessed the path in my program via the normal connection/dataadapter/dataset method. I've gotten to the point where I can output the path as a string in a message box. Does anybody know a function that would allow me to open that file in its associated application? In other words, when I cause...
2
1016
by: Doug Bell | last post by:
Hi, Recently I asked how to write code to open an App from its associated file. I got assistance from Ken show me the Process.Start command. I would now like to start the App that I have built from its associated file type. Could someone advise me on how I make my App aware of the specific (associated) file that has started it.
6
10030
by: qysbc | last post by:
I have a web page and there is a link to open a TIFF file. The way I do it is to have the server code open a binary stream, set the content type to "image/tiff" and call Response.BinaryWrite. On the client machine, the file type TIFF is associated with Kodak Imaging Preview. This app works on most client machines. When you click on the link, Kodak Imaging Preview will open the TIFF file on the client machine. However, on some machines, the...
2
1559
by: Shilpa | last post by:
Hi All, I want to write C# code to identify a file type and open the file in the associated editor. For example, text files should be identified and opened in notepad, html should be opened in internet explorer/netscape/mozilla. At design time, I do not know if internet explorer/netscape is installed on the client machine. The C# code should identify that and open.
2
4416
by: OutdoorGuy | last post by:
Greetings, I have a "newbie" question in relation to opening files from C#. I have a Windows form where I allow the user to type in a file extension in a text box (e.g., "xls"). I then take that extension and use that as my filter criteria for the File Open dialog. Once the user selects a file with that extension (from the File Open dialog), I simply want to open that file (whether it is an .xls file, .txt file, etc.). I am...
0
4966
by: Salad | last post by:
A97. Split database. Frontend DB1.MDB. Backend DB1BE.MDB. Tables are linked between DB1 and DB2. From my testing, if I open DB1 exclusively using /excl the backend DB1BE is not opened exclusively. If I open DB1 but have no tables open and then open up DB1BE exclusively, DB1BE will open exclusive. But if I then attempt to open a linked table in the frontend DB1 I'm informed I can't use the table because the file is in use.
5
2509
by: Looch | last post by:
Hi All, I have a memory stream that I saved an XML doc to. I can open an XML file in I.E. using: System.Diagnostics.Process.Start("C:\\MyXML.xml"); My question is what is the syntax for:
0
9031
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8902
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6528
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5862
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4372
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4623
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3052
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2339
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2007
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.