Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / General MS InfoPath Questions / January 2007

Tip: Looking for answers? Try searching our database.

InfoPath 2007 insertrow

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
BobC - 08 Jan 2007 15:13 GMT
I have code that works in InfoPath 2003:
           Dim nodeRowStart As XPathNavigator =
e.Source.SelectSingleNode("/d:WorkOrders/d:Activity[1]",
NamespaceManager)
           If nodeRowStart Is Nothing Then
               System.Windows.Forms.MessageBox.Show("nodeRowStart not
valid")

           Else

               ' insert the row insert before will place it on top.

               Me.CurrentView.ExecuteAction("XCollectionInsertBefore",
"Activity_10")

           End If

This no longer works in 2007.

The updated line

Me.CurrentView.ExecuteAction(ActionType.XCollectionInsertBefore,
"Activity_10")

The specified bstrAction value for the View.ExecuteAction call is not
applicable for the current selection.
BobC - 08 Jan 2007 15:22 GMT
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.

Rate this thread:






 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.