Hi,
Could someone please show me how to open an existing file from VB.
Thanks In Advance!
~Mark
Printable View
Hi,
Could someone please show me how to open an existing file from VB.
Thanks In Advance!
~Mark
Do you mean put text in your program?
Or do you mean open an exe file?Code:Open "C:\file.txt" For Input As #1
Text1.Text = Input$(LOF(1), 1)
Close #1
Code:Shell "C:\file.exe", VbNormalFocus
.exe - I appreciate your help!
Matthew,
I need to open any file (i.e. .htm, .doc, etc). If the OLE contol worked properly, that would be perfect...
Thanks,
Mark
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