-
Hi to All!
I'm stumped with something that I know has to be a simple procedure. Can anyone help...Please?
I am trying to make a VB "command button" open Notepad.exe + a specified .txt file. I can get Notepad to open but, I'm not sure of the proper syntax to open the textfile in Notepad.
Here is what I have so far, any suggestions would be most greatfully appreciated!:
Private Sub cmdCommand1_Click()
Call Shell("C:\windows\notepad.exe", vbNormalNoFocus)
End Sub
Many Thanks!
Ronnie Bussey
-
You just pass the file you want to open as a parameter to the command line.
Code:
Private Sub cmdCommand1_Click()
Call Shell("C:\windows\notepad.exe " & Text1.Text, vbNormalNoFocus)
End Sub
Assuming of course that the TextBox named Text1 contains the name of the file you want opened with it.
-
Thank You!
Hi Gen-X!
Thanks for the tip. I knew it had to be something fairly simple. I just couldn't find anything that referenced the proper syntax for the procedure.
Thanks again for your time and consideration!
Regards,
Ronnie Bussey