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

Sendkeys ALT question

Status
Not open for further replies.

baltman

Technical User
Mar 5, 2002
1,578
US
Can't seem to figure it out. I want to send an ALT-n using sendkeys, but it doesn't seem to work.

I'm using WshShell.Sendkeys("%{n}"). What might I be doing wrong? I believe the % represents ALT...

Thanks,
Brian
 
Hi Brian,

Don't think you need the braces around the n.

You might want to include the setup code. CREATEOBJECT etc.

Regards,

Mike
 
Yep, you're all right.

I'm using it to ensure that the next sendkeys places a path and filename into a saveas box...

It's frustrating trying trial and error with sendkeys because of its nature of occurring right away.

Thank you.

Code:
WshShell = CreateObject("WScript.Shell")
.
.
.
oWeb.navigate2("[URL unfurl="true"]https://www.xxx.com"+lcStep2)[/URL] &&file path
.
.
.
WshShell.SendKeys("%n")
WshShell.SendKeys(ADDBS(lcSavePath)+STRTRAN(JUSTSTEM(lcstep2)+"."+JUSTEXT(lcstep2),"%20","_"))
WshShell.SendKeys("{TAB}")
WshShell.SendKeys("{TAB}")
WshShell.SendKeys("{ENTER}")
 
("{%}n")
I believe that the braces are to be around the special character?

Attitude is Everything
 
Hi Danceman,

Mike is right. Braces around the % is used to send the literal % instead of ALT.

Regards,

Mike
 
It's frustrating trying trial and error with sendkeys because of its nature of occurring right away.

Stick a few inkey() in the required places. Take a look at faq1251-5510


Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top