Link to home
Start Free TrialLog in
Avatar of CTrip1
CTrip1

asked on

associate files

HI,
I have created a Text Editor,
How I can associate *.txt files with my Editir.
meaning: when someone will click on a txt file,
instead of seeing it in Notepad, he will see it in
my Text Editor.

Thanks,
ASKER CERTIFIED SOLUTION
Avatar of andysalih
andysalih

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of JonFish85
JonFish85

check this out:

http://www.vbsquare.com/files/association/

hope it helps!
or

To manually associate a file format with an application, but not the application's file icon:
1. Choose Start > Programs > Windows Explorer.
2. Select a file whose file format association you want to change. For example, if you want to change the file format association for all TIFF files, select a TIFF file.
3. Press Shift+F10, or Shift+right-click the file you selected in step 2.
4. Choose Open With from the pop-up menu. (If Open With is not available, repeat steps 2-3.)
5. In the Open With dialog box, select the application with which you want to associate the file format. If the application isn't listed, click Other, then locate the desired application.
6. Select the option labeled "Always use this program to open files of this type" and click OK.
7. Repeat steps 1-6 for any other file format associations you want to change.


hope this helps
Andy

Avatar of Ark
Hi

Dim objWSHShell As Object
Set objWSHShell = CreateObject("WScript.Shell")
        objWSHShell.RegWrite "HKCR\txtfile\shell\open\command", "c:\Editors\MyCoolEditor.exe %1"
Set objWSHShell = Nothing

Cheers

Hi CTrip1,

Another useful link: http://www.mvps.org/vbnet/code/reg/association.htm

'Hope will help.
Hi CTrip1,
It appears that you have forgotten this question. I will ask Community Support to close it unless you finalize it within 7 days. I will ask a Community Support Moderator to:

    Accept andysalih's comment(s) as an answer.

CTrip1, if you think your question was not answered at all or if you need help, just post a new comment here; Community Support will help you.  DO NOT accept this comment as an answer.

EXPERTS: If you disagree with that recommendation, please post an explanatory comment.
==========
DanRollins -- EE database cleanup volunteer
Per recommendation, force-accepted.

Netminder
CS Moderator
now hang on a second, here.

I have a question while we are on the topic.  How is it that you get you app to associate with the file type ... hmmmmm (for give me I'm a n00b).

For instance, when I open a given file type in explorer, how does my program know what exactly to do with that file?
lillockey,

You'll have a better chance of getting an answer if you ask a new question...

Netminder
EE Admin