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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Alternative in VBscript to sendkeys "^(c)"

Status
Not open for further replies.

dhtguru

Technical User
Jan 7, 2007
9
I need to be able to copy highlighted text into the clipboard without using the above. I couldn't find anything in the forums that exactly matched what I needed.

THanks
 
Here's a couple of threads that look like they may be helpful to you:

thread329-604622
thread329-1576951
 
Thanks for the quick response. However, these two posts don't seem to address my issue. I am tabbing on a website and as I tab each area where I tab to is being highlighted. I need to be able to copy the highlighted data to the clipboard each time I tab. Without using Control + c.
 
the alternative to sendkeys, I would think, is to use the HTML DOM to tab through the fields and and copy the data that way. But this might require that the vb code be apart of the HTML.

What kind of access to you have to the HTML?

-Geates



"I hope I can feel and see the change - stop the bleed inside a feel again. Cut the chain of lies you've been feeding my veins; I've got nothing to say to you!"
-Infected Mushroom

"I do not offer answers, only considerations."
- Geates's Disclaimer
 
I don't have access to the HTML.
 
What about using Shift+Del instead of control+c? or are you trying to eliminate the use of sendkeys altogether?

-Geates

"I hope I can feel and see the change - stop the bleed inside a feel again. Cut the chain of lies you've been feeding my veins; I've got nothing to say to you!"
-Infected Mushroom

"I do not offer answers, only considerations."
- Geates's Disclaimer
 
The problem I am having with control+c for some reason. Sometimes it will paste the letter c in the field to be copied instead of performing a copy.
 
That may just be a timing issue. Throw a delay between each sendkey
Code:
wscript.sleep 200  '200 ms

Will you post your code and relevant link to the HTML?

-Geates

"I hope I can feel and see the change - stop the bleed inside a feel again. Cut the chain of lies you've been feeding my veins; I've got nothing to say to you!"
-Infected Mushroom

"I do not offer answers, only considerations."
- Geates's Disclaimer
 

As you cand see I have tried Shift + F10 also, but it will sometimes loose its focus and the line and the script will fail.

Wscript.Sleep 100


' objShell.SendKeys("+{F10}")
' objShell.SendKeys "c"'

objShell.SendKeys "^c"'


Wscript.Sleep 300
 
Code:
objShell.SendKeys "^c"
send a "^" and then a "c".

Code:
objShell.SendKeys "^(c)"
send a ctrl+c

-Geates


"I hope I can feel and see the change - stop the bleed inside a feel again. Cut the chain of lies you've been feeding my veins; I've got nothing to say to you!"
-Infected Mushroom

"I do not offer answers, only considerations."
- Geates's Disclaimer
 
Thanks that seems to be doing the trick.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top