4 Jun 2013

Capture the screen shot withou word object

How to the Capture the screen shot withou word object

'Create a function as showed below.

'Taking Screenshot using word object

Set oWordBasic = CreateObject("Word.Basic")

oWordBasic.SendKeys "{prtsc}"
oWordBasic.AppClose "Microsoft Word"

Set oWordBasic = Nothing
'WScript.Sleep 2000

wait 10

'Opening Paint Application
set WshShell = CreateObject("WScript.Shell")

WshShell.Run "mspaint"
'WScript.Sleep 2000

wait 10
'Activating Paint Application
WshShell.AppActivate "untitled - Paint"

'WScript.Sleep 1000
 wait 10
'Paste the captured Screenshot

WshShell.SendKeys "^v"
'WScript.Sleep 500
wait 10

'Save Screenshot
WshShell.SendKeys "^s"
wait 10
'WScript.Sleep 500
WshShell.SendKeys "c:\test.bmp"
wait 10
'WScript.Sleep 500
WshShell.SendKeys "{ENTER}"

wait 10

'Release Objects
Set WshShell=Nothing

wait 10

No comments:

Post a Comment