WebQuery Runtime Properties

CurrentHTMLResult

(Channel As Integer) As String

This is the InnerHTML property of the returned element for the current match. It returns an empty string when there is no match.

CurrentNodeIndex

(Channel As Integer) As Long

This property returns the current matched node's index. This property is especially useful inside the ValidateNode event to refer to the node that meets the control criteria. It is usually fed to GetHTMLNodes property to return the node object to the VB developer who has experience working in MSHTML parser. This property is 1 when no match is found outside of ValidateNode.

CurrentTextResult

(Channel As Integer) As String

This is the InnerText property of the returned element for the current match. It returns an empty string when there is no match.

GetHTMLNodes

(Channel As Integer, nodeIndex As Long) As Object

This property returns the object of a certain node in the HTML document. This object is especially useful when assigned to an HTML HtmlElement variable (defined in MSHTML) to have direct access to all the properties of the node. Moreover, you could use this node object to walk all the nodes of the document by going to parentElement object or childNodes&etc. as you wish.

GetHTMLResult

(Channel As Integer, resultIndex As Long) As String

This returns the InnerHTML property of the returned element for the resultIndex match. It returns the empty string in case of no match.

Calling this method moves the current match to this one as well.

Normally, you may provide criteria that perfectly tighten the search around the node of target. However, this might not be easy and your criteria could lead to several matched in the HTML document. This property helps walk though all the list of matches one by one using an index from 0 to the number of available matches in the document minus one.

GetNextMatch

(Channel As Integer) As String

Calling this method moves to the next match and returns the corresponding InnerText. This is an easy way to walk the available matches in the current document. Every time you read this property it returns the next match, you can choose to stop when it returns the empty string, it is probably the end of match, however, only CurrentNodeIndex gives the right answer for this.

GetTextResult

(Channel As Integer, resultIndex As Long) As String

This returns the InnerText property of the returned element for the resultIndex'th match. It returns the empty string in case of no match.

Calling this method moves the current match as well just like in GetHTMLResult above.

GotoNode

(Integer)

This property will transfer a call to another control. See GotoNode.

IsDataAvailable

(Channel As Integer) As Boolean

This is useful when using the InProgress exit. You can check this property at any time to know if the HTML page is loaded so that you decide to revisit the control from CheckBackEntry to continue processing.

NodeOffset

(Channel As Integer) As Long

The value of INodeOffset property, after entering from the Main Entry, is copied to this property. You can read from or write to it, as you like. However, when you write a new value all the results are updated on the fly.

A typical use of this property would be to try to assign different values to it and read the CurrentTextResult or CurrentHTMLResult as you want. This will help you return multiple results that are neighbouring the current match at different distances.

SearchText

(Channel As Integer) As String

The value of the ISearchText property is copied to here after entering from the Main Entry and applying the property substitution. This property is read only.

SourceURL

(Channel As Integer) As String

The value of the ISourceURL property is copied to here after entering from the Main Entry and applying the property substitution.

Read more about WebQuery control.