WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

OLE with MSIE
plus

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

Get Objects in MSIE Form


Question:

How can I get type of object and name of each object in a MSIE form with OLE?

Answer:

Maybe this is what your looking for:
url = "http://www.gotomypc.com" ;!!!!!CHANGE TO FIT YOUR NEEDS!!!!!
formname = "LogIn"  ;!!!!!CHANGE TO FIT YOUR NEEDS!!!!!

objBrowser = ObjectOpen("InternetExplorer.Application")
objBrowser.visible = @true

objBrowser.navigate(url)

while objBrowser.readystate <> 4
	timedelay(0.5)
endwhile

objBrowserDoc = objBrowser.Document
objForm = objBrowserDoc.forms(formname)  
objElements = objForm.elements
count = objElements.length

for i = 0 to count-1
 objField = objForm.elements(i)
 name = objField.name
 type = objField.type
 message("Field",StrCat("Name = ",name,@CRLF,"Type = ",type))
 ObjectClose(objField)
next i


ObjectClose(objElements)
ObjectClose(objForm)
ObjectClose(objBrowserDoc)
ObjectClose(objBrowser)
Referenced tech article: http://techsupt.winbatch.com/webcgi/webbatch.exe?techsupt/nftechsupt.web+WinBatch/OLE~COM~ADO~CDO~ADSI~LDAP/OLE~with~MSIE+Example~of~using~the~IE~Object~Interface.txt
Article ID:   W16119
File Created: 2014:07:18:09:51:38
Last Updated: 2014:07:18:09:51:38