1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
| Sub Lancer_Edoc()
Dim ie As New InternetExplorer
Dim RegEx As RegExp, RegMatch As MatchCollection
Dim MyStr As String
Set ie = New InternetExplorer
Set RegEx = New RegExp
ie.Navigate2 "https://vpnssl.bouygues-construction.com/dana-na/auth/url_12/welcome.cgi"
While ie.Busy
Wend
Dim htmldoc As HTMLDocument
Set htmldoc = ie.Document
Dim SearchTextField As HTMLObjectElement
Dim htmlElement As HTMLObjectElement
'Dim htmlElement As HTMLText
For Each htmlElement In htmldoc.all
' If (htmlElement.tagName Like "INPUT") Then
If (InStr(1, htmlElement.outerHTML, "type=text") > 0 Or InStr(1, htmlElement.outerHTML, "type=") = 0) Then
Set SearchTextField = htmlElement
'Debug.Print
Debug.Print "ok"
End If
'End If
'Debug.Print htmlElement.outerHTML
'Debug.Print htmlElement.innerText
'Debug.Print htmlElement.TabIndex
Next
On Error Resume Next
SearchTextField.Value = "oj"
ie.Visible = True
End Sub |
Partager