Categories: MSDN / DotNet / Java / Scripts / Linux / PHP Ask - La ask - La Answer

how to paste?

Hi

I am trying to write an application that paste some text into a textbox in any other applications in focus. Like when you press CTRL+V and you paste from clipboard.

I would like to enter for example CTRL+1 and it would paste some text into any application in focus that has an textbox.

I dont know how to do the pasting. I have successfully registered "global" hotkeys that respond when I press them, but how can I paste into some other application (lets say any textfield in IE)?

best regards
/Arnold
[544 byte] By [Arnold] at [2007-11-11 7:00:25]
# 1 Re: how to paste?
Pasting:

Text1.SelText = Clipboard.GetText 'THIS IS FOR TextBox
RichTextBox1.SelRTF = RTF.SelRTF = Clipboard.GetText 'THIS IS FOR RTF

Copying:

Clipboard.Clear
Clipboard.SetText RichTextBox1.SelText 'you can do this in a textbox too

Cutting:

Clipboard.Clear
Clipboard.SetText RichTextBox1.SelText 'you can do this in textbox
RichTextBox1.SelText = ""
XRsTX at 2007-11-11 17:27:38 >