2013-03-05 115 views

回答

2

要捕獲桌面屏幕截圖,請使用Sys.Desktop.Picture方法。向所得到的圖像保存到一個文件,使用其SaveToFile方法:

Sys.Desktop.Picture.SaveToFile "E:\screenshot.png" 

或者,你可以打開Test Visualizer自動捕獲您的測試操作截圖。

+0

感謝您的回覆,@海倫 – Ramakrishna 2013-03-22 05:26:34

+0

@YallaRamakrishna:如果是爲你工作,請其標記爲解決答案,這樣其他人就知道了。 – Helen 2013-03-22 08:17:33

+0

其實我是堆棧溢出的新用戶。我真的不知道它會如何標記請告訴我程序。 – Ramakrishna 2013-03-26 10:04:16

0
Function CaptureScreenShot(ScreenshotPath) 
    'Generate Name of the Image 
    strimgFileName="Img\Img" & Day(Date)& Month(Date) & Year(Date) & Hour(Now) & Minute(Now) & Second(Now) &".jpg" 
    strImgFile= ScreenshotPath & strimgFileName 
    'Capture failure Screen shot 
    Set objPic = Sys.Desktop.Picture() 
    'Save captured Screen shot 
    ExecutionStatus = objPic.SaveToFile(strImgFile) 
    'Return Captured image name 
    CaptureScreenShot=".\" & strimgFileName 
End Function