For Programmers: Free Programming Magazines  


Home > Archive > Visual Basic Syntax > March 2005 > send keys????









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author send keys????
PCOR

2005-03-25, 4:00 pm

If you want to type in the letter e you just press the e key
if you want to type in an e with an accent è you type in ALT 138
Here is what I would like to do
Click on a command button and the è(with the accent and all) would be placed
on the cpliboard.
Is there a way to do this with the SENDKEYS or any other way
Thanks


--
Norton Professional 2004 says this email is clean...believe it


Jeff Johnson [MVP: VB]

2005-03-25, 4:00 pm


"PCOR" <ianmacfa@hotmail.com> wrote in message
news:ibCdnTdR8-dRxdnfRVn-1w@rogers.com...

> If you want to type in the letter e you just press the e key
> if you want to type in an e with an accent è you type in ALT 138
> Here is what I would like to do
> Click on a command button and the è(with the accent and all) would be
> placed on the cpliboard.
> Is there a way to do this with the SENDKEYS or any other way


Private Sub btnInsertEBreve_Click()
Clipboard.Clear
Clipboard.SetText Chr$(138)
End Sub


(Or is that a grave accent?)


PCOR

2005-03-26, 3:59 pm

Thanks for the help...BUT using this code and placing CHR$(138) on the

clipborad produces a S which is the code for ALT 0138

So it looks like all the chars that start with a zero are OK. Now How do I

get the other sin there(Like CHR$(138)= è

Thanks again

"Jeff Johnson [MVP: VB]" <i.get@enough.spam> wrote in message
news:ONykftWMFHA.3928@TK2MSFTNGP09.phx.gbl...
>
> "PCOR" <ianmacfa@hotmail.com> wrote in message
> news:ibCdnTdR8-dRxdnfRVn-1w@rogers.com...
>
>
> Private Sub btnInsertEBreve_Click()
> Clipboard.Clear
> Clipboard.SetText Chr$(138)
> End Sub
>
>
> (Or is that a grave accent?)
>



Rick Rothstein

2005-03-26, 3:59 pm

> > > If you want to type in the letter e you just press the e key
be[color=darkred]
> Thanks for the help...BUT using this code and placing CHR$(138) on the
>
> clipborad produces a S which is the code for ALT 0138
>
> So it looks like all the chars that start with a zero are OK. Now How

do I
>
> get the other sin there(Like CHR$(138)= è


Part of the problem seems to come from your original post. In it, you
said that typing ALT 138 (I need to put a zero in front of the 1 for
this to work) produced è... however, on my system, I need to type ALT
0232 to get that character (ALT 0138 produces the Š that you are
seeing). So, if you use the correct ANSI code, then Jeff's program code
should work

Private Sub btnInsertEBreve_Click()
Clipboard.Clear
Clipboard.SetText Chr$(232)
End Sub

You can find the ANSI codes for the various characters in a given font
by using the Character Map program that comes with all versions of
Windows.

Rick - MVP

PCOR

2005-03-26, 8:58 pm

Many thanks to both of you...got it going the way I want.
Now a quick explanation.
Typing with the numeric key pad..if I type ALT138 or ALT0232 I get this = è
But if I say..in Visual basic

Private Sub btnInsertEBreve_Click()
Clipboard.Clear
Clipboard.SetText Chr$(138)
End Sub
Now when I paste it into a document I see the letter S with a squiggly on
top
but if I say in VB
Private Sub btnInsertEBreve_Click()
Clipboard.Clear
Clipboard.SetText Chr$(232)
End Sub
I get exactly what I want which is è
Voila
again many thanks

Rick Rothstein" <rickNOSPAMnews@NOSPAMcomcast.net> wrote in message
news:%235d9zUiMFHA.3760@TK2MSFTNGP12.phx.gbl...
> be
> do I
>
> Part of the problem seems to come from your original post. In it, you
> said that typing ALT 138 (I need to put a zero in front of the 1 for
> this to work) produced è... however, on my system, I need to type ALT
> 0232 to get that character (ALT 0138 produces the Š that you are
> seeing). So, if you use the correct ANSI code, then Jeff's program code
> should work
>
> Private Sub btnInsertEBreve_Click()
> Clipboard.Clear
> Clipboard.SetText Chr$(232)
> End Sub
>
> You can find the ANSI codes for the various characters in a given font
> by using the Character Map program that comes with all versions of
> Windows.
>
> Rick - MVP
>



Rick Rothstein

2005-03-26, 8:58 pm

> Typing with the numeric key pad..if I type ALT138 or ALT0232 I get
this = è

Hmm! Yes, I see it does work without the leading zero... but it didn't
used to be that way. I'm using WinXP Pro and maybe WinXP added whatever
functionality it is that allows ALT138 to work (I'm almost positive that
it wouldn't have worked in my prior versions of Windows... I'm almost
sure the leading zero was required). Anyway, I don't know what the 138
stands for, but the 232 is the ANSI value for the character and it is
the one that needs to be used with the Chr$ function. Also, the number
you place after ALT+0 (note the zero) is the ANSI number (which you can
get from the previously cited Character Map program). Again, I'm not
sure what encoding that 138 is, but it looks like that is never the one
to use with the Chr$ function.

Rick - MVP

Jeff Johnson [MVP: VB]

2005-03-27, 4:00 am


"Rick Rothstein" <rickNOSPAMnews@NOSPAMcomcast.net> wrote in message
news:Obh8HKkMFHA.1176@TK2MSFTNGP15.phx.gbl...

> Hmm! Yes, I see it does work without the leading zero... but it didn't
> used to be that way. I'm using WinXP Pro and maybe WinXP added whatever
> functionality it is that allows ALT138 to work (I'm almost positive that
> it wouldn't have worked in my prior versions of Windows... I'm almost
> sure the leading zero was required). Anyway, I don't know what the 138
> stands for, but the 232 is the ANSI value for the character and it is
> the one that needs to be used with the Chr$ function. Also, the number
> you place after ALT+0 (note the zero) is the ANSI number (which you can
> get from the previously cited Character Map program). Again, I'm not
> sure what encoding that 138 is, but it looks like that is never the one
> to use with the Chr$ function.


Nothing to do with Windows XP; this behavior has been around for quite some
time. I'm going to offer an explanation based on a dim memory, so it's
probably far from accurate, but the gist is there. In ye olden days of DOS,
there was The Extended IBM Character Set(TM). It was by Americans, for
Americans (John Philip Sousa marches play in the background). You could type
the characters in this extended set by holding down Alt and entering the
3-digit number on the numeric keypad. (You could actually enter any
character this way, but it made typing a letter a real XXXXX.)

Then Windows came along and brought with it all this wussy globalization
crap, as if software outside the good ol' US of A mattered one bit (flags
wave patriotically). The ANSI character set became the norm, but for
backwards compatibility (hey Microsoft, remember that concept? Friggin'
..NET. Wait, where was I?) the ability to access the extended IBM characters
was maintained in Alt+###, so to access the ANSI characters you had to use
Alt+0###.


Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com