Setting File Open Attributes...

Posted on 2003-03-02
Medium Priority
Last Modified: 2010-05-01
I've just made a nice little code-snippet storage program, basically Notepad with fewer features and a *.code extension...got everythign set up and running smoothly...but the file-type association "open" action refuses to load the text. If I use the "Open..." dialog in my program, it runs fine. But, if I just double click on a .code file, all it does is loads the Code Program, without the code itself. Again, the file is not corrupted. I have a file association, added through View>>Folder Options>>File Types...with one command, "open", pointed at the program's directory. Do I need to add a subroutine to my program's code? Or am I missing something with the file type declarations?
Question by:Jodah
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
LVL 28

Accepted Solution

vinnyd79 earned 200 total points
ID: 8054226
Make sure the open action has a %1 after it to represent the file.

"C:\SomeDir\MyApp.exe" "%1"

Then I think you will need to tell your app to open the file that is represented by %1.You could use Command$ for this:

Private Sub Form_Activate()
If Command$ <> "" Then
    ' command$ will represent the filename
    ' load file here
    MsgBox Command$
End If
End Sub

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

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…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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…
Suggested Courses

801 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