Wednesday 30 March 2016

Virtual Keys - Control/ Capture Keyborad and Mouse to complete your tasks

Sub Virtual_Keys()
' To run this example please open word and ensure the title of the word file is Document1 - Microsoft Word. If not please update the title in the below AppActivate code
' This example will type your Name in word document and would automatically populate save and send feature.
' Good examples for beginers
 
AppActivate "Document1 - Microsoft Word"
Application.Wait (Now + TimeValue("00:00:02"))
Application.SendKeys ("Hello" & " " & Application.UserName)
Application.SendKeys ("%{f}{d}") ' Virtual Keys % = ALT & FDA = Save and Send as attcahment
Application.SendKeys ("{a}")

End Sub

No comments:

Post a Comment