Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all articles
Browse latest Browse all 21136

Improper capitalization in KeyBd_Event

$
0
0
The code below works fine except the "KeyBd_event" is sending a lowercase letter for each letter in "name".
The "name" which I imput is "John Q Jones" but what I get out is "john q jones".

What am I doing Wrong?????


Private Sub SendAKey(name)
Dim Start As Integer, NameLen As Integer, sKey As String
Start = 1
NameLen = Len(name)

If NameLen > 0 Then
Do While Start <= NameLen
sKey = Mid(name, Start, 1)

nVK = VkKeyScan(Asc(sKey))
nVK = (nVK And &HFF)
keybd_event nVK, 0, 0, 0

Start = Start + 1
Loop
Else
MsgBox "Enter some Valid input", vbExclamation
End If
End Sub

Viewing all articles
Browse latest Browse all 21136

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>