PDA

Click to See Complete Forum and Search --> : opening a file with a program.


Robert_Trebor
Aug 30th, 2001, 04:44 PM
how could I open a file with a program, like if you open a *.txt file it automatically opens in notepad. is there a way of finding out this file's name?

um, I've been having a lot of trouble with the vb-world website, so if you could e-mail your response to
robert_trebor@my-deja.com
I'd really appreciate it.

And if anyone knows about changing user access levels in NT, I'd appreciate being told how. is there a MAKE_ADMIN api?

Megatron
Aug 30th, 2001, 06:30 PM
Use the ShellExecute function.

Private 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

Private Sub Command1_Click()

ShellExecute hwnd, "open", "C:\MyFile.txt", "", "", 1

End Sub