Get ClipboardText over recorded shortcut cmd+C

Ask general questions here.
urbach1907
Posts: 2
Joined: Thu Nov 22, 2007 8:23 am

Get ClipboardText over recorded shortcut cmd+C

Post by urbach1907 » Thu Nov 22, 2007 9:24 am

Hi folks,

In a tested application I want store a marked text with a shortcut to the clipboard. When I try to get this back in .NET via Clipboard.GetText(); it didn't give back the copied string.

Regards,
Frank

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Post by Support Team » Thu Nov 22, 2007 12:38 pm

I just tried to copy a portion of text from the Windows Notepad by sending the key combination "Ctrl + C":

Code: Select all

Application.SendKeys("{CTRLDOWN}c{CTRLUP}{CTRLDOWN}v{CTRLUP}");
string clipboardText= System.Windows.Forms.Clipboard.GetText();
That worked for me.

Can you please provide us your test code, perhaps we can reproduce the error that way.

Regards,

Alex
Ranorex Support Team

urbach1907
Posts: 2
Joined: Thu Nov 22, 2007 8:23 am

Post by urbach1907 » Sat Nov 24, 2007 6:48 pm

Thanks for your reply. I had some trouble with the right shortcut for marking the text. I solved this and now it works.
Cool tool!

Frank