[vb6.0/vba] Find IE / 열려있는 익스플로워(InternetExplorer) 창을 찿아 URL을 바꿈

하나를하더라도최선을 2020-03-16 21:51:07 33,678 0 0

열려있는 인터넷 익스플로워(InternetExplorer) 창을 찿아서 모두 URL을 바꾸어 주는 예제 입니다.
 
 
 
 
Dim IE As Object
 
Sub FindIE()
    Dim obj As Object, Count&, URL$, Title$
    Set obj = CreateObject("Shell.Application")
    On Error Resume Next
    Count = obj.Windows.Count
    For x = 0 To (Count - 1)
        URL = obj.Windows(x).Document.Location
        Title = obj.Windows(x).Document.Title
        If TypeName(obj.Windows(x).Document) = "HTMLDocument" Then
            Set IE = obj.Windows(x)
            IE.Navigate2 "http://map.daum.net/?q=" + UTF8([A1].Text)
        End If
        Debug.Print Title, URL, TypeName(obj.Windows(x).Document)
    Next
End Sub
 
 
 
 

댓글 0개

첫 번째 댓글을 작성해보세요!