Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Opening Files With Your Program

Posted on 2004-04-10
2
Medium Priority
?
269 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 500 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

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

886 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