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 / August 2007

Tip: Looking for answers? Try searching our database.

Need to Count the Forms in a Form Library using VBscript

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Noah Kaufman - 29 Aug 2007 00:08 GMT
Hi -

I have a form that needs to be able to return the number of InfoPath forms
contained within an InfoPath form library within SharePoint using vbscript.

I have already set up the form library as a data source in my form.  
Assuming the data source is called "foobar", what would be the xpath that I
would pass to the .selectNodes() method in order to be able to then use
.nextNode() to be able to go through the nodes sequentially?  (so that I can
count them)

Alternatively, if this is _not_ the best way to count the number of XML
documents within the form library -- what would be a better method, assuming
that I have to use vbscript to do it?

Thank you very much, in advance, for taking the time to answer my question.

Sincerely,

Noah Kaufman
New World Design
Cambridge, MA, USA
Shiva (GGK Tech) - 29 Aug 2007 07:20 GMT
Hi,

You have to give the XPath from root node to your repeating node (whichever
you want collection of nodes).

dim nodes = foobar.selectNodes(“XPath of your repeating section”);
dim count = nodes.length;

Check the below link you can get the idea about XPath:
http://www.w3schools.com/xpath/xpath_nodes.asp

Hope this helps you.

Signature

Shiva
http://www.ggktech.com

> Hi -
>
[quoted text clipped - 18 lines]
> New World Design
> Cambridge, MA, USA
Noah Kaufman - 30 Aug 2007 16:38 GMT
Hi Shiva -

Thank you very much for responding to my post.

Yes, I understand that we have to specify the XPath expression for the
SharePoint forms library.  My question is what _is_ the specific XPath for a
form library in a top-level site collection called "foobar"?

I've tried using similar XPath to what one would use for a list in
SharePoint without much success, so I thought that perhaps the specific XPath
syntax or content was different when attempting to manipulate a SharePoint
form library.

Sincerely,

Noah Kaufman

> Hi,
>
[quoted text clipped - 31 lines]
> > New World Design
> > Cambridge, MA, USA
 
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.