Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sending Keys to Notepad

Status
Not open for further replies.

FindusTheCat

Programmer
Jul 16, 2002
2
DE
Hello,

I've got a big problem: I want to send keystrokes to the Windows Notepad but I don't want the user to see the notepad-Programm. So I choose the option vbHide (Sourcecode see below).
But it doesn't work...if I select the option vbNormalFocus it works without any trouble, but as already said, I don't want to see the user the notepad-program.
It could be also helpful if sb. could tell me how to get text into the clipboard...
Thank you very much,

Findus

Sourcecode:

Private Sub Befehl0_Click()
Dim pad As Long
pad = Shell("C:\notepad.exe", vbHide)
AppActivate pad, True

SendKeys "Hello World !"
End Sub
 
Well, perhaps the best way then would be to use the Open Method?

Code:
Open "C:\Windows\Temp\Temp.txt" For Append As #1
Print #1, "Hello World!"
close #1
 
Hello,

thanks for your tip...so far so good, but now another problem has occured. The next step I have to do doesn't work with the open-method, because I have to execute a DOS-program and send keys to the DOS-program...you got an idea how to manage this ?

Greetings,

Findus
 
I am by no means a programmer but would sending the info the clipboard, open your DOS prompt and paste work?

Just a thought [peace]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top