Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    Visual Basic




Open App. By Association


How can I open a program by its association to the file extention from within in my app. I would like to have my app. load the app. that is associated with *.dxf. Or how would I use shell to send the file to the program (I would have the user select the program to open with)? ??command$??




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
File Association And Open Them...
Hi
I am making a program wich,currently, is supposed to edit text files (easy)

1°)
but i want to create a file association like '.test' how can i update the registry?

2°)
after, when i open a file without using the program, i want my program to open this file.....

Thanks
BladeFrZn

Open File With Default Program Association
Hi All,

Does anybody know how to open a file with whatever program Windows has associated with the file? For example let's say I want to open a .xls file but one computer might use Excel and another computer might use OpenOffice. Is there a way to open the file from a VB app similar to double clicking on the file from Windows Explorer?

Thanks for your help.
Kevin

Open A File With Default Text Editor That Has No File Association
I wrote a program that creates a log file and then opens it using whatever program is associated with the extention log.  This works fine as long as the user has associated log with a program.  If user does not have log associated with a program, I trap the error and open the log file using notepad.  What I'd really like to do in that case is open the file with whatever text editor is associate with txt files (many of my users do not use notepad as their default).  Any idea how I can determine which program is associated with txt files in that case?

Association
hi, i know a lot of ppl have asked this question but ive not seen an good working answer yet. how can i associate a certain filetype with my prorgam and set its icon with VB?

is there a way that will work on every OS and set it for every user?

is there a way to make it add something to the begginging of the command string when it opens instead of just giving the filename eg "SPKopen=c:file"

Association
How do i associate a file type with my program, so that my program opens when a file of this type is clicked?

Need Association
hi

i see lot of developers around... is there any association by which we can market the products we have develop... if so can any one give me some info.... i have few medical App which i like to market it in countries india, Malaysia, Thailand, Indonesia….
any one in it or wanna be contact me khalik_ash@yahoo.com .
any suggestion and tips welcome...

let make a differences

File Association
Hello, anyone knows where to find a good tutorial on file association. i've found some code about this but haven't be able to undestand the hall scope. What i need is to create my own shortcut for my application and the files saved, linked to my program. When clicked on a file made from the app, first i need to make some adjustments in my application then make the information visible.

File Association
When my program runs for the first time on a computer, it associates a certain file type with itself, by adding the appropriate entries to the registry. When I right click on a file with my extension, choose "Open With..." and then click on my app, my program runs and displays the contents of whatever file I'd just opened - Success! However, if I double-click the file, or right click and choose open, my app runs but the filename is not passed to my app. This doesn't really make sense to me - anyone know how to fix this?

The registery changes I made are the following:

Created 'HKEY_CLASSES_ROOT.myext' and changed default value to 'MyApp.Doc'

Created 'HKEY_CLASSES_ROOTMyApp.Docshellopencommand' and changed default value to '"C: hepathofmy.exe" "%1"'

Why will clicking "Open" not work, when using "Open With..." is doing the exact same thing, but works???

Help!

Customization Association
not strictly a programming question, but...

I customized my contact form and published it. When i try to add a new contact the new form appears, thats good. But when i open a contact that was already there it appears in the old contact form.

How can i update it so that all contacts use the same form.


Thanks a lot guys.

File Association
I have about 700 files that are not defined. I want to associate all of them to be .smc files. How do i go about doing this without the monotonous procoess of renaming/reassociating each one individually?

-Thanks in advance!

File Association
Hi Folks

I was wondering if anyone knew how to associate a file to an executeable that I have writen so that the file opens the application, and the application then knows what to do with the file?

The program is a stand alone database application and the file is a monthly update. The idea being that the file can be double clicked to perform the update as opposed to the user selecting the file (which is what happens at present).

I know how to set up file association through the windows settings/folder options but was looking for a programatic solution. Any ideas?

PS the database HAS to be standalone! - if I was allowed to establish a connection my life would be so much easier!


Thanks in advance

File Association
Hi All!

I am developing my own Mp3 Player, and would like to associate all ".Mp3" Files with it...
I know I can use the "Command" Function in VB, And I also know how to associate filetypes.

...But, I would like to know how I can overcome the following problem...
When I select multiple files in explorer, I want them to be added to the playlist just like WinAmp does.
Winblows opens a new instance of my program each time.

I saw a post on this board, which said that someone would have to do something like this...
1) Check if program is already running!
2) Use the FindWindow() stuff
3) SendMessage() -- Pass it to the other instance

How would I do something like this?
Thanks a lot in advance...

With Friendly Regards,
Kevin

Association Of Files
Can someone tell a (near) beginner how I can make files created by my VB application to be associated with that application, e.g. as happens when you click on a .doc file?

File Association
We have ftp macros set up as .vbs files. Clicking on them ran the macros in the CuteFTP transfer engine. Made the mistake of reassociating .vbs files to a text editor and now the macros won't run in Cutre even though the extension has been changed back from .txt to .vbs. How can we undo our error? Thanks!

File Association?
I know how to associate the file type with my software... but how do I get my program to recognize that a file type has called it? So let's say I made a text editor, and when you open a text file, it launches my program. The text file should be open inside it, right? How do I make that happen?

Thanks!

File Association
I've tried to search google, for file association in vb, but i always get errors...
Somethimes i get error like, can't edit hkey_class_root or something...

So can anyone explain how to make my own file extension?

File Association
Hi there!

How can I open a file having the it's extension?.

eg: My system returns ".doc, .bmp, .jpg.........etc", and I want to open the file using Windows File associations. Is it possible to do it ??

Thanks in advance and have a great weekend!!!!

File Association.
Boy this is difficult when you can't see what is happening!

I'm trying to get my app to load a txt file when I double click it. Apparently the double clicked file name is stored in a variable named "Command$". In my child form I have these lines


Code:
If Command$ <> "" Then
FileCopy Command$, App.Path & "Undefined.ini"


I have an error trap :

Code:
MsgBox "Error " & Err.number & " (" & Err.Description & ") on line " & Erl & " in Form_Load of FrmInput" & Command$


Which produces the line :

Code:
Error 52(Bad file name or number on line 30 in Form_Load of FrmInput"C:Documents and SettingsSamRDesktopPunching Shear 1.PShear


I remember in the olden days that filenames couldn't contain spaces. Is this the case with Command$. Is there a way around this or is there something I'm not seeing?

File Association.
I'm trying to associate a file extension with my program using code from the codeback. For some reason the file type is created but not the association (opens with). This is the calling line that I've modified to suit my program.

http://vbforums.com/showthread.php?t=241188

What's does %1 and the ,-1 do? Are they surposed to be there?
Also, what's the difference between the sEXE and sCommand variables? Why would they need to be different and why is one optional?


Code:
AssociateMyApp "PUNCH Project", App.Path & "PUNCH.exe %1", "PShear", App.Path & "PUNCH.exe,-1", App.Path & "Perim.ico"

Mail Association
Hey!

What i need is a code for "loading" a e-mail adress into my program.

like when you click a email link fx: test@test.com it will open outlook. i need it to write the mail adress in a form like text1=mailadress..

hope you understand

Is this posible?

Association Problem
As the final touch to a large VB6 application, I want the main app to start when an app-created datafile is clicked on. The datafile(s) has a non-controversial extension and I’ve associated it properly to the main app via the usual Windows mechanism. When I double-click the datafile then the main app starts correctly but it reckons that it can’t find the data file that was clicked on to start it.

The little app below demonstrates the problem. In my case, I’ve called the main app ‘Assoc.exe’ and the datafile (which just contains junk) as ‘data.aso’ – and associated the .aso extension with the Assoc.exe application.


VB Code:
Option Explicit Private Sub Form_Load()Dim FSO As FileSystemObjectSet FSO = New FileSystemObject    If Command() <> "" Then        MsgBox "File is " & Command()        If FSO.FileExists(Command()) Then            MsgBox "Found " & Command()        Else            MsgBox "Cannot find " & Command()        End If    Else        MsgBox "No filename passed by association"    End If   Unload MeEnd Sub


Any ideas? Any solutions? It’s driving me crazy….

TIA
Dave

File Association
Hi all,

http://www.vbcodemagician.dk/tips/files_association.htm

I am using the site above to link zip files to my application (ZIP Archiver). Its working fine, icon changes and on the double click of the file, my application is executing. How can I pass filename to my application as parameter so that I may be able to extract the file directly.

Thanks.

File Association Example Zip?
Hi,

Can anyone post an example project on how to work file associations? Preferably an example project where it shows you how to create your own file extensions and then associate that file type with a specific application. Thanks in advance.

File Association ??
I have made a program which makes a data file, with a single table, and saves the files with an extension .ndt, and saves whichever data is added to it. Another application ( data retriver) Opens it, opens the table, and shows all the records in the data in a MS Flexgrid. Now this part is completed.

What I wanted next is to make a file association ( of .ndt file with the data opener). I made the file association manually. & associated the "Open" action for the .ndt file to the data retriver.

Now when I double click on the data file, the data retriver is started, but the data file is not loaded into it. How can I do this ?

File Association
Umm...how do you change the file association of particular extentions from within VB?

Icon Association From Within VB
Can anyone point me in the right direction here?

When the user saves a normal textfile from within my VB program, I want the user to be able to select an icon from disk to associate with that textfile, so when viewing the file normally, that textfile will have the chosen icon.

E.g.: The user creates an adventure file and wants to have an icon of a sword, he then creates another adventure file and wants to have a warrior icon.

All files will be associated with my program so no matter what icon he / she chooses, double-clicking will load my program.

The file extension is .sec

Any help will be appreciated

File Association Help
This is the problem though you know when a person clicks start browse and opens a file and it goes to that program, and the information is opened up. Like when you open a word document and the information opens up in the textbox. Well I have three listboxes that I save the information in and open it when the user clicks open and then selects the file. Is there a way that I when the user clicks start browse and selects the file they saved by using my program the information saved is opened in the three listboxes. Here is the code I used in the open box, the code splits the information in three listboxes.

[highlight=VB]
cdbexpenditures.Flags = cdlOFNOverwritePrompt + cdlOFNExplorer
cdbexpenditures.Filter = "Expense files (*.exp)|*.exp"
cdbexpenditures.CancelError = True
cdbexpenditures.ShowOpen
sfilename = cdbexpenditures.FileName

Open sfilename For Input As #1
Do While Not EOF(1)
Line Input #1, sfilename
strlistdata = Split(sfilename, "::")
list1.AddItem strlistdata(0)
List2.AddItem strlistdata(1)
List3.AddItem strlistdata(2)
Loop
Close #1
lblexpense.Caption = ""
lbldate.Caption = ""
lblprice.Caption = ""
[vbcode]

File Association
How do I associate a file with my application and display my progrms icon for the file icon, through code?

File Association
Right, here's how it goes:

I have created a peice of software and need to be able to have the *.pba files associated with it so that when you double click them they load in my software.

I can create an association in windows easily and make it run my prog from a double-click but I can't get it to then run the open file module. The prog just loads with no file open as if it was run in the normal way.

Any tips would be great.

Is there some way to tell that the prog has been run from clicking on an associated file?

Cheers in advance

Nick
----------------------------------------------

File Association
I want to associate a file extension I have devised for my application. This was the easy bit. How do I now get my program to open and load the (RTF) file into the RTF Box and also create the file association when the program is first run. If someone can point me in the right direction I would be most grateful.


Thanks in advance

Rich


Richard Hare
Haresoftware

Agr! File Association
Does anyone know the link to the tip about file association on Vb-world.net? Their search function isn't working for me, and I can't find it! I just want to know how to associate a file with my program!

File Association ...
How do i associate files with my app? and can i prevent the users from openin' those files with another app?

File Association
If i have created file association in the windows registry how can i check it is still working next time the program runs?

Thanx
IceSoft

Please Help With File Association
How can I retrieve the file path and file name of the file who is double-clicked and who open my application ?

If it is possible, I need a working example !

Thanks !

How Do I Get A File&#039;s Association?
How do I get a file's association?

E.G.
blahblah.txt ---> Text file
blahblah.doc ---> Word document
blahblah.exe ---> Executable


-----------------
Niv
steiny@netvision.net.il

File Association
I suceed in associating a file to my program but can't get the program to open the file, can anyone help and also explain how to use the "program.exe %1" statment,

Thanks

File Association
Trying to create a file association in VB. Everything I'm doing works fine with one slight problem. It doesn't work until I actually go into folder options and edit the open action. I Do not not actually edit anything though, just going in seems to set it to begin working. Does anyone know why I have to do this. I don't want users to have to do this for my program. Re-booting doesn't set the file association either.

File Association
I have made my program so it is associated with a certain extension, lets say .abc for example. When i open a .abc file my program opens up, but i don't know how to get the path of the .abc file i open to be recognized by my program so it can do whatever it needs to do to that file. Any ideas on how i can do this?

File Association, Please Help
Is there a way to get the icon that is associated with a certain extentision and put it into a imagelist or picturebox. I am using vb6 and havent been able to find any code to do this so far

File Association
how can i make a code that when i double click on a file in a file-list, will execute the file with the program that it is associated with ?

WMI Tables Association
hi guys,

I'm wondering about how to associate info of win32_networkadapter and win32_idecontroller taken with wmi,

Some clues?

Thanks in advance...

File Association
I have a picture program. I want to make it default viewer of JPG files.

Dim strCmdLine As String

strCmdLine = Command$()

If strCmdLine<>"" Then
'Open the file
End If

When I double click a JPG file in explorer, it works well.

But now the problem is:

I have opened 1 file. When I double click the second file in explorer, my program can't replace the first file with the second one.

Anyone could help?

File Association?
How can i make it so that all of the files with my extension (*.sur) will make my program open up that file? Thanks again!

File Association
How to get file assocaition in VB ?I have a file open dialog box.If I select a doc file it should open it with latest MSword,if it is pdf it should open in Acrobat reader etc.I can't use word objects or shell command bcoz i will have to hard code the progID which is diff. for diff. versions of word. like Word.Application.8, Word.Document.6 etc.
Any suggestions ???
Thanx in advance.

File Association
I have written programs using C++/MFC and it is relatively easy to associate a file extension with my program. So that when, in the File Manager, the user clicks on a '*.LIQ' file it knows to open it with my application.
Is there a way to do this in Visual Basic?

Rob.

File Association Question
Hey. I already know how to setup my installer to make my program open a file and how to open the file from the command$ string. My question is how do you make your program open a file when it is already running? My software only runs 1 copy on the machine at a time. Is there an easy way to send it a message like "Hey buddy grab this file:". I'd prefer something like interupt driven where i'm not polling something with a timer every 100ms or so. It seems like MS word and many other programs have some standard functionality with this. Thanks!!!

Professional File Association
There is a lot of code around for file association. What I mean by this is API calls that associate a custom file type with your VB program so that it has a nice icon, opens by double clicking, etc.


My concern is - it seems a bit like "hacking" the registry. What is the professional way of doing this? Should the user have the option? Should there be a "disaccociate" option that deletes the key (I could not find code for this). Should the installer take care of this issue rather than doing it in the body of the program with API calls?


All opinions welcome - but my question is for those that have distributed code to others - if I wasn't doing that, I'd be satisfied with the API calls - they work fine.


Thanks.

File Association Problems
The name of my program is MultiText. You can open more than one text document at a time and each one gets its own tab. The program works fine. However, I figured out how to write to the registry to get my app to associate with files of its extension. It works great when I open one file, either by double-clicking the file or dragging it onto my app, but something strange happens when I do two. If I drag multiple files onto the app's icon, they both open fine. But when I select multiple files, right click, choose "Open", the program doesn't even execute. I am almost certain that the problem lies within the association in the registry. Even if I change the first line of my program to msgbox command, it shows fine when I open one file, but when I do multiple files, it doesn't even show (so obviously the program isn't even executing.) What I write in the registry to HKEY_CLASSES_ROOTMultiTextshellopencommand is: "C:whatevermultitext.exe" %1 . That is with quotes. The problem, I think, is the %1. What do I use instead to make the association pass on the right path to the app?

INNO - File Association
I want to create file association for my program..
It means that I want to double click on my file...that was created by my program. It's a new extension...And now...
How could I setup INNO to open this file with my program?
Do I even use INNO for it?
Tnx!

Copyright © 2005-08 www.BigResource.com, All rights reserved