Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Navigating HTM
#2
Member function Htm.NavigateIndex_
Code:
Copy      Help
function navig [Htm&result]

;Gets an element near this element in the collection of all elements in the document.
;Error if navig is too big and there is no element at the result index.

;navig - offset of the element index from the index of this element. For example, if -1, gets previous element in the collection.
;result - if used, receives the result. Else the result will be this variable.


MSHTML.IHTMLDocument2 d=el.document
MSHTML.IHTMLElementCollection c=d.all
int i=el.sourceIndex+navig
MSHTML.IHTMLElement t=c.item(i)
if(t=0) end ERR_BADARG
if(&result) result.el=t; else el=t

example
Macro Macro21
Code:
Copy      Help
out
int w=wait(3 WV win("Quick Macros Forum - Internet Explorer" "IEFrame"))
Htm e=htm("A" "QM Home" "" w "0" 4 0x21 3)
sub.Out(e)
e.NavigateIndex_(-1)
sub.Out(e)


#sub Out
function Htm&e

out F"{e.Tag} ''{e.Text}''"


Messages In This Thread
Navigating HTM - by stupomer - 06-23-2018, 11:11 PM
RE: Navigating HTM - by Gintaras - 06-24-2018, 04:56 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)