Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Opening a VB app with a windows file extnesion?

Status
Not open for further replies.

UncleT

Programmer
Sep 26, 2001
133
US
Hello,

I was wandering if there was a way to open a VB exe by clicking on a file with a certain exe. I know it can be done but I have no clue to accomplish it. Here is what I want to do. I want to write an VB applicaton that is strictly a Crystal Reports Viewer. On the client PC I want to associate a .rpt with this VB Application. When the user double clicks on the .rpt file it will open up the report in my VB application. I know how to write the VB application as a Crystal viewer and I know how to associate a file type with an application. The question I have is when the user clicks on the file how can I open up that file with my app?

Any help would be greatly appreciated.

UncleT
 
You need to associate the file extension (.rpt) with your application. This is done with the Windows folder preferences dialog. In Windows Explorer, select Tools | Folder Options | File Types, and find your extension in the list (or add it if it's not already there).

Be aware that if another application is already using .rpt, you'll be taking away it's association, and your users may not be expecting this.

Chip H.


____________________________________________________________________
If you want to get the best response to a question, please read FAQ222-2244 first
 
The VB application that I wrote needs a file name and path in order for the application to open the report. When the user double clicks on the .RPT file how can I get the name of the report and its path in the VB application? Does it come in as a parameter or what?
 
In your form's load event or sub main, which ever code you run first try this:

msgbox command

command will be your filename and path.



Two strings walk into a bar. The first string says to the bartender: 'Bartender, I'll have a beer. u.5n$x5t?*&4ru!2[sACC~ErJ'. The second string says: 'Pardon my friend, he isn't NULL terminated'.
 
Hi All:

I have a similar question, I need to open an app; with a
custom extension called ".4ca" basically I am trying to get it to work like Word, i.e. you click on a word doc and that doc is opened for you, basically my app does not know the filename until the user clicks it so specifying the file in SubMain won't really work. Any ideas on how to make this work?

TIA
MeonR
 
MeonR-

Did you read the post by chiph? And then the post by DrJavaJoe? Putting the two posts together pretty much tells you how to accomplish what you want.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top