我想将一个窗口的IE.Document带入另一窗口的IE.Document。能做到吗?
我看不出你的问题背后的含义。但是您可以通过以下方式做到这一点:
Sub DocFromIEtoIE()
Dim ieOne As Object
Dim ieTwo As Object
Dim nodeHTML As Object
Dim htmlDoc As String
Dim url As String
url = "https://stackoverflow.com/"
Set ieOne = CreateObject("internetexplorer.application")
ieOne.Visible = True
ieOne.navigate url
Do Until ieOne.ReadyState = 4: DoEvents: Loop
Set nodeHTML = ieOne.document.getElementsByTagName("html")(0)
If Not nodeHTML Is Nothing Then
htmlDoc = nodeHTML.outerHTML
Set ieTwo = CreateObject("internetexplorer.application")
ieTwo.Visible = True
ieTwo.navigate "about:blank"
Do Until ieTwo.ReadyState = 4: DoEvents: Loop
ieTwo.document.Write (htmlDoc)
End If
End Sub