ShellExecute

centiipede
08-25-2000, 02:36 PM
This question is Real basic. I just need to know how to do a shell command that would launch an application like notepad, and display in notepad (etc) whatever is in my Text1 text box.

thanks!

centipede
cent1pede@hotmail.com

çentipede
http://mp3.com/orguss

SoldierBoy
08-25-2000, 02:50 PM
i think
shell("c:winnt
otepad.exe " & text1.text)
was how I did it.

centiipede
08-25-2000, 03:05 PM
hmm. When I entered this code in, it just caused VB to shut down. im getting a variable from the application's registry entry, like this:

dim strLauncher as string
strLauncher=getsetting(app.title,"Settings","txtEditor","")

shell(strLauncher & mdiMain.ActiveForm.rtfMain.text)


thanks.
centipede
cent1pede@hotmail.com

çentipede
http://mp3.com/orguss

amram71
08-25-2000, 08:09 PM
You can do...

Shell "C:WindowsNotepad.exe", vbNormalFocus
SendKeys "Hello, my name is centiipede!"
This requires no API
If you are not familiar with SendKeys, it tells the computer to key the letters in the string

Grimfort
09-07-2000, 11:23 AM
The 'Shell' function only takes the name of an executable file to open. Looking at your code you are creating a string that does not actually point to a file.
If you do a message box of the concatanated string that you have got inside the shell command (e.g Msgbox strLauncher & mdiMain.ActiveForm.rtfMain.text), you will see that it is probably not an actual filename.

Grimfort

Derek Stone
09-07-2000, 07:20 PM
Simply save what is in the textbox to a temporary file and then Shell to notepad passing the filename.
This is both simple and reliable.
SendKeys works but not all the time.

Good Luck
-cl

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum