open file with application

lekmall

Registered User.
Local time
Today, 13:29
Joined
Jan 19, 2004
Messages
24
Does anyone know how to open a text file with a specified application? The extension of the file that I want to open is not .txt and it won't be registered on the user's computer. I just want to call 'Notepad.exe' and then specify the file it is to open????

Thanks!
 
lekmall said:
Does anyone know how to open a text file with a specified application? The extension of the file that I want to open is not .txt and it won't be registered on the user's computer. I just want to call 'Notepad.exe' and then specify the file it is to open????

Thanks!

Can't you just rename the file to have the txt extension:

strPth = "C:\Whatever.jps"
strNewPth = Left(strPth,len(strPth)-3) & "txt"

Name strPth As strNewPth


then open it with:

application.FollowHyperlink strNewPth

then when done reverse the naming process

Name strNewPth As strPth

HTH

Jordan
 
Last edited:
Thanks, Monkey Man.
I thought of that, but can't do it. When the file has been opened with Notepad, it will have the .txt extension. The user may want to save the file while it's open and they will be confused when they see that the extension is not what it should be and I would get calls telling me "Hey, what's going on? We're not used to this!"
 

Users who are viewing this thread

Back
Top Bottom