Sub google()
Set objIE = CreateObject("InternetExplorer.Application")
WebSite = "www.google.com"
With objIE
.Visible = True
.navigate WebSite
Do While .Busy Or .readyState <> 4
Application.SendKeys "({1068})", True
DoEvents
Loop
AppActivate "Internet Explorer"
ActiveSheet.Paste
Dim shp As Shape
With ActiveSheet
Set shp = .Shapes(.Shapes.Count)
End With
shp.Height = 600
shp.Width = 800
.Document.Forms(0).Submit
'.Quit
End With
End Sub
我正在使用此代码使用Excel VBA宏截取屏幕截图。但是,此代码将截取我的整个屏幕截图。我需要一个网页的截图。有人可以帮我这个吗?
答案 0 :(得分:3)
PrtSc 截取整个桌面的截图。要截取当前应用程序窗口的屏幕截图,请使用 Alt + PrtSc 。
Application.SendKeys "%{1068}", True