|
-
Aug 5th, 2000, 10:00 PM
#1
Thread Starter
New Member
Hi,
Could someone please show me how to open an existing file from VB.
Thanks In Advance!
~Mark
-
Aug 5th, 2000, 10:10 PM
#2
Do you mean put text in your program?
Code:
Open "C:\file.txt" For Input As #1
Text1.Text = Input$(LOF(1), 1)
Close #1
Or do you mean open an exe file?
Code:
Shell "C:\file.exe", VbNormalFocus
-
Aug 5th, 2000, 10:34 PM
#3
Thread Starter
New Member
THANKS
.exe - I appreciate your help!
-
Aug 5th, 2000, 10:45 PM
#4
Thread Starter
New Member
any file using windows associations
Matthew,
I need to open any file (i.e. .htm, .doc, etc). If the OLE contol worked properly, that would be perfect...
Thanks,
Mark
-
Aug 6th, 2000, 12:33 AM
#5
To open any file, use the ShellExecute function.
Code:
Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
Public Const SW_SHOWNORMAL = 1
ShellExecute Me.hwnd, vbNullString, "C:\file.htm", vbNullString, "c:\", SW_SHOWNORMAL
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
|