Solved

Opening Files With Your Program

Posted on 2004-04-10
2
260 Views
Last Modified: 2010-05-02
I am making an audio player, and I don't want to have to go File >> Open every time I want to listen to a song.

Is there any way to make it so whenever you double click a program, or use 'Open With...' it will automatically start processing the file with the audio player?
0
Comment
Question by:momonja
2 Comments
 
LVL 39

Accepted Solution

by:
appari earned 125 total points
ID: 10799549
first create file association so that your application gets executed when you double click on the file. for information on how to create file association go through this article http://vbnet.mvps.org/index.html?code/reg/association.htm

once your file association is created whenever you double click on a file your application gets executed and you can get the name of the file clicked by seeing the value in "command"

in your startup form's load event or sub main check the value of command, you will get the filename. use that value to open that file.
0
 

Author Comment

by:momonja
ID: 10799616
Thanks a ton!

I think it should be made clear though that to get the file name, all one has to do is:

dim i as string
i = command


For a while, I tried to do command1.value.
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now