Here is the IP 2003 code that works.
<InfoPathEventHandler(MatchPath:="btn_ActAddtotop",
EventType:=InfoPathEventType.OnClick)> _
Public Sub btn_ActAddtotop_OnClick(ByVal e As DocActionEvent)
Dim nodeRowStart As IXMLDOMNode =
thisXDocument.DOM.selectSingleNode("/d:WorkOrders/d:Activity[1]")
If nodeRowStart Is Nothing Then
'thisXDocument.UI.Alert("nodeRowStart not valid")
Else
' insert the row insert before will place it on top.
thisXDocument.View.SelectNodes(nodeRowStart,
Type.Missing, Type.Missing) ' select the firs row in the list.
'thisXDocument.UI.Alert("Message to user..)
thisXDocument.View.ExecuteAction("xCollection::insertBefore",
"Activity_10") ' insert before the first row in the list.
End If
End Sub
> I have code that works in InfoPath 2003:
> Dim nodeRowStart As XPathNavigator =
[quoted text clipped - 22 lines]
> The specified bstrAction value for the View.ExecuteAction call is not
> applicable for the current selection.
S.Y.M. Wong-A-Ton - 30 Jan 2007 07:37 GMT
Try this link: http://msdn2.microsoft.com/en-us/library/aa944286(VS.80).aspx
---
S.Y.M. Wong-A-Ton
> Here is the IP 2003 code that works.
> <InfoPathEventHandler(MatchPath:="btn_ActAddtotop",
[quoted text clipped - 45 lines]
> > The specified bstrAction value for the View.ExecuteAction call is not
> > applicable for the current selection.