Taking Screen Shot of an Application using VB Script



‘**********************************************************************************************************************************
'Taking Screen  Shot of an Application
‘**********************************************************************************************************************************

'Minimising All the Application
Set wshShell1 = CreateObject("Shell.Application")
wshShell1.MinimizeAll
WScript.Sleep 100

'Launching the GMail Application
Set objIE = CreateObject("InternetExplorer.Application")
objIE.Visible = True
objIE.Navigate "www.gmail.com"

'Creating Shell Scripting Object
Set wshShell = CreateObject("WScript.Shell")

'Pressing the PrintScreen Button
wshShell.SendKeys "{PRTSC}"
WScript.Sleep 100

'Opening the MS Paint Application
wshShell.Run "MSPaint"
WScript.Sleep 100

'Sending the Paste Command
wshShell.SendKeys "^v"
WScript.Sleep 100

'Save Screenshot
WshShell.SendKeys "^s"
WScript.Sleep 100
WshShell.SendKeys "c:\ScreenShot.bmp"
WScript.Sleep 100
WshShell.SendKeys "{ENTER}"

'Release Objects
Set wshShell=Nothing
WScript.Quit

‘**********************************************************************************************************************************

No comments:

Post a Comment