|
複数のIEのテキストを取得する参考です。
Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
Sub test()
Dim MyShell As Object
Dim MyWindow As Object
Dim cnt As Integer
Dim mybody As String
Dim mybdyline As Variant
Set MyShell = CreateObject("Shell.Application")
cnt = 0
For Each MyWindow In MyShell.Windows
If UCase(Right(MyWindow.FullName, 12)) = "IEXPLORE.EXE" Then
cnt = cnt + 1
mybody = MyWindow.Document.body.innertext
Sleep 100
DoEvents
mybdyline = Split(mybody, vbCrLf)
ActiveSheet.Cells(1, cnt).Resize(UBound(mybdyline) + 1) = WorksheetFunction.Transpose(mybdyline)
Erase mybdyline
End If
Next MyWindow
End Sub
|
|