Speichern von Snapshots mithilfe von vbscript

Ich bin neu in vbscript. Ich möchte speichern Sie einen snapshot genommen, wenn Sie vbscript verwenden, der eine internet explorer-Fenster geöffnet, indem vbscript.

Code zum laden der Seite

Dim IE, stateString
Set IE = WScript.CreateObject("InternetExplorer.Application")
ie.toolbar = 1
ie.statusbar = 1
ie.width = 999
ie.height = 500
ie.left = 20
ie.theatermode = false
ie.theatermode = true
ie.theatermode = false
ie.top = 50
ie.navigate("file:///C:\Users\Vinit_Tiwari\Documents\vbscripts\someform.html")
'stateString = cstr(ie.readystate)
waitforload(ie)


ie.visible = 1

Set wshShell = CreateObject("Wscript.Shell")

wshShell.AppActivate "Some Form"
wshShell.SendKeys "% x"

Code, um Schnappschuss

Dim oWordBasic
set oWordBasic = CreateObject("Word.Basic")
oWordBasic.sendkeys "{prtsc}"
oWordBasic.AppClose "Microsoft Word"
Set oWordBasic = Nothing
Wscript.Sleep 2000

Speichern der snapshot -

dim paint
set paint = wshShell.exec("mspaint")
do while paint.status = 0:loop
wshShell.appactivate("untitled-Paint")'this returns false
Wscript.sleep 500
WshShell.SendKeys "^v"
wscript.sleep 500
wshshell.sendkeys "^s"
wscript.sleep 500
wshshell.sendkeys "d:\test.png"
wscript.sleep 500
wshell.sendkeys "{Enter}"
Set wshshell = Nothing

Tatsächlich die zuvor geöffnete ie-Fenster mit Fokus und Tastatureingaben an den ie anstelle von Farbe. so gibt es eine Funktion führt, die gegenüber der Arbeit von AppActivate.

InformationsquelleAutor codeomnitrix | 2012-04-09

Schreibe einen Kommentar