-2

I am looking for a VB script to send the following keyboard commands:

Ctrl+w

If anyone can assist me I would greatly appreciate it. Thanks!

user1572695
  • 53
  • 2
  • 10

1 Answers1

2

Have a look at the SendKeys function:

SendKeys "^w", True ' ^ indicates holding 'Ctrl', second parameter is 'Wait'

More resources:

Using AppActivate and Sendkeys in VBA shell command

http://msdn.microsoft.com/en-us/library/office/aa202943%28v=office.10%29.aspx

http://www.tek-tips.com/faqs.cfm?fid=5037

Community
  • 1
  • 1
staafl
  • 3,147
  • 1
  • 28
  • 23