Context Sensitive Help in Custom Task Pane - Infopath 2007

M

Matt

I previously designed a few InfoPath 2003 forms which displays context
sensitive help in the custom task pane. The following VBScript works fine in
InfoPath 2003 but throws an "object not defined" error on the line
(identified by arrows) below in InfoPath 2007:

'Global variable to keep track of last help topic displayed,
'so that it can be cleared on context change and the
'new topic will display alone

dim helpstring

Sub XDocument_OnContextChange(eventObj)
On Error Resume Next
Dim oTaskPane
dim oHTMLDoc
msgbox eventObj.Context.nodeName
If eventObj.Type = "ContextNode" Then
Set oTaskPane = XDocument.View.Window.TaskPanes.Item(0)
Set oHTMLDoc = oTaskPane.HTMLDocument.all
oHTMLDoc.item(helpString).style.display="none"
-------> oHTMLDoc.item(eventObj.Context.nodeName).style.display=""<---------
helpString=eventObj.Context.nodeName
End If
If err.number <> 0 Then
Set oTaskPane = XDocument.View.Window.TaskPanes.Item(0)
Set oHTMLDoc = oTaskPane.HTMLDocument.all
oHTMLDoc.item(helpString).style.display="none"
oHTMLDoc.item("Default").style.display=""
helpString="Default"
err.clear
End If
End Sub

If anyone can tell me what could be causing the problem, I'd greatly
appreciate it. I'd like to keep the forms in VBScript to prevent re-writing
all the custom code.

Thanks,

Matt
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top