|
-
Jul 18th, 2000, 07:53 PM
#1
I asked a question about file associations quite a while ago, but I didnt really get the help that I needed,
I know how to associate my app with a file type,
but how do I open the file in my app?
say I associated *.txt files with my app, how would I open the contents of the text file in a text box in my app?
Thanks,
Dennis Wrenn
-
Jul 18th, 2000, 08:44 PM
#2
When the file is launched using your App the Path and File name of the File is passed to your application. Use the "Command" function to retrieve this command line and use it to open the File and display it in your Textbox, i.e.
Code:
Private Sub Form_Load()
Dim iFile As Integer
Dim sFile As String
iFile = FreeFile
Open Command For Input As iFile
sFile = Input(LOF(iFile), iFile)
Close iFile
Text1 = sFile
End Sub
-
Jul 19th, 2000, 10:38 AM
#3
THANK YOU!!!
ok, but what if they just open the app without opening a text file??
would I do something like this?
Code:
Private Sub Form_Load()
Dim iFile As Integer
Dim sFile As String
If Command <> "" Then
iFile = FreeFile
Open Command For Input As iFile
sFile = Input(LOF(iFile), iFile)
Close iFile
Text1 = sFile
End If
End Sub
???
Thanks Again,
Dennis Wrenn
-
Jul 19th, 2000, 12:01 PM
#4
What extensions are you having your program open with?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|