Hi,
I am having trouble converting a bit of JScript code I got from a colleague (which I think he got from here) into VBScript. The code had already been modified from the original but I'm losing it in translation.
In JScript, the code works by testing this line in the if statement:
oHTMLDoc.item(eventObj.Context.nodeName)
I can not find the equivalent in VBScript no matter how much I google! I don't have intellisense but I did have a look through the values in Watch to give me some ideas... and I'm still very lost.
Can anyone help please?
Dim
helpStringSub XDocument_OnContextChange(eventObj)
If eventObj.Type = "ContextNode" Then
'Retrieve html object for task pane. oHTMLDoc = XDocument.View.Window.TaskPanes.Item(0).HTMLDocument.all 'Clear previous help topic from task pane
if (helpString) then oHTMLDoc.document.body.childItem(helpString).style.display="none"
'if the field does have an entry in the HTML i.e. it's not null
if oHTMLDoc.document.body.childItem(eventObj.Context.nodeName) <> null then
'Keep record of string displayed, so can later be cleared.
helpString = eventObj.Context.nodeName
'Display corresponding HTML DIV statement having same ID as the context node name.
oHTMLDoc.document.body.childItem(eventObj.Context.nodeName).style.display = ""
'If there's no specific help available default to the filler div in the HTML
else
helpString = "filler"
'Display corresponding HTML DIV statement having same ID as the context node name.
oHTMLDoc.document.body.childItem(helpString).style.display=""
End If
Exit SubEnd If
End
Sub