VB6 copy and paste

Associate
Joined
26 Feb 2004
Posts
971
Location
China (Qinhuangdao)
I've just had to buy a new keyboard out here in China. I bought the Logitech K350, but as I feared, it's more of a US keyboard layout, so has no £ sign.

It does have programmable buttons but it won't let me have the key assignment for £ because there isn't one on the US keyboard. So I want to write a small program in Visual Basic 6 that copies the £ sign and pastes it.

so far I have a module, with :

Clipboard.Clear
Clipboard.SetText "£"
End

So now the programmable button launches this program and I have the sign in the clipboard, so I simply press ctrl-V to paste it.

However, I thought it would be nice if it would paste it by itself to whatever program I had been using. For example if I was using Excel, and I hit the button, the program would change the focus back to Excel and paste it, rather than just closing.

Do you think this is possible?
 
Possible? Yes. Easily Done? Definitely not.

For Excel and Word you'd be better of using the built-in Auto-Correct feature. Define something like pnd$, something that you're unlikely to need in future, as £ and every time you type it Excel/Word will automatically replace it with the £ symbol

Alternatively, couldn't you just use the Extended ASCII code for £ - 156? Hold down Alt and press 1, 5 and then 6 on the Numpad.
 
WOW!! I never even thought down these lines! And the last tip - incredible!! Thankyou!! Never knew about the Alt- trick! :)
 
The long forgotten alt codes can get you out of all sorts of trouble. They can also produce weird looking file names :)
 
Back
Top Bottom