Hi Dhirendra,

You can try

Desktop.CaptureBitmap("Filename.png or .bmp",True) to capture screen shot.

You can give your file name on run time.


Thanks
Nikhil Gangwar


On Thu, May 30, 2013 at 2:45 PM, dhirendra soni <[email protected]>wrote:

> Hi All,
> I have below code to take snapshot on any active open window but what if the
>
>  system is not installed with the mS word, then it fails.
> Any idea??
>
>
> 'Taking Screenshot using word object
> Set oWordBasic = CreateObject("Word.Basic")
> oWordBasic.SendKeys "{prtsc}"
> oWordBasic.AppClose "Microsoft Word"
> Set oWordBasic = Nothing
> WScript.Sleep 2000
>
> 'Opening Paint Application
> set WshShell = CreateObject("WScript.Shell")
>
> WshShell.Run "mspaint"
> WScript.Sleep 2000
>
>
> 'Activating Paint Application
> WshShell.AppActivate "untitled - Paint"
> WScript.Sleep 1000
>
> 'Paste the captured Screenshot
> WshShell.SendKeys "^v"
> WScript.Sleep 500
>
> 'Save Screenshot
> WshShell.SendKeys "^s"
> WScript.Sleep 500
> WshShell.SendKeys "c:\test.bmp"
> WScript.Sleep 500
> WshShell.SendKeys "{ENTER}"
>
> 'Release Objects
> Set WshShell=Nothing
> WScript.Quit
>
>  --
> --
> You received this message because you are subscribed to the Google
> "QTP - HP Quick Test Professional - Automated Software Testing"
> group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/MercuryQTP?hl=en
>
> ---
> You received this message because you are subscribed to the Google Groups
> "QTP - HP Quick Test Professional - Automated Software Testing" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
-- 
You received this message because you are subscribed to the Google
"QTP - HP Quick Test Professional - Automated Software Testing"
group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/MercuryQTP?hl=en

--- 
You received this message because you are subscribed to the Google Groups "QTP 
- HP Quick Test Professional - Automated Software Testing" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to