Guest User

Untitled

a guest
Feb 23rd, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. Dim HTMLDoc As MSHTML.HTMLDocument
  2. Dim HTMLButtons As MSHTML.IHTMLElementCollection
  3. Dim HTMLButton As MSHTML.IHTMLElement
  4. Dim btnInput As MSHTML.IHTMLInputElement
  5. Dim ie As Object
  6. Dim pointer As Integer
  7.  
  8. Set ie = CreateObject("internetexplorer.application")
  9. ie.Visible = True
  10. ie.navigate "http://www.htmlquick.com/reference/tags/input-file.html"
  11.  
  12. Do While ie.readyState <> READYSTATE_COMPLETE
  13. Loop
  14.  
  15. Set HTMLDoc = ie.document
  16. Set HTMLButtons = HTMLDoc.getElementsByTagName("input")
  17.  
  18. For Each HTMLButton In HTMLButtons
  19. For Each btnInput In HTMLButtons
  20. If btnInput.Type = "file" Then
  21. HTMLButton.Click
  22. btnInput.Value = "C:temptest.txt"
  23. pointer = 1
  24. Exit For
  25. End If
  26. Next btnInput
  27.  
  28. If pointer = 1 Then Exit For
  29.  
  30. Next
Add Comment
Please, Sign In to add comment