InfoPath Collections

 <  Day Day Up  >  

The InfoPath 2003 object model has seven collections, each of which is described briefly here.

The DataObjects Collection

The DataObjects collection contains zero or more DataObject objects. Each DataObject object represents a secondary data source for an InfoPath form.

DataObjects Collection Methods

The DataObjects collection has no methods.

DataObjects Collection Properties

The DataObjects collection has two properties:

  • Count ” Read-only. The number of DataObject objects in the DataObjects collection.

  • Item ” A reference to a specified DataObject in the DataObjects collection.

In JScript, to assign the first DataObject in the DataObjects collection to a variable myVariable , you would write

 myVariable = XDocument.DataObjects.Item(0); 

In VBScript, omit the semicolon at the end of the code.

The Errors Collection

The Errors collection contains the Error objects associated with a form.

Errors Collection Methods

The Errors collection has three methods:

  • Add() ” Adds a new Error object to the Errors collection and returns a reference to the object. Security level 2.

  • Delete() ” Deletes a named Error object from the Errors collection. Security level 2.

  • DeleteAll() ” Deletes all the Error objects in the Errors collection. Security level 2.

Errors Collection Properties

The Errors collection has two properties:

  • Count ” Read-only. A long integer representing the number of Error objects in the Errors collection. Security level 0.

  • Item ” Read-only. A specified Error object in the Errors collection. Security level 0.

The TaskPanes Collection

The TaskPanes collection represents the task panes associated with a window in an InfoPath form.

TaskPanes Collection Methods

The TaskPanes collection has no methods.

TaskPanes Collection Properties

The TaskPanes collection has two properties:

  • Count ” Read-only. A long integer value representing the number of TaskPane objects in the TaskPanes collection. Security level 0.

  • Item ” Read-only. A reference to a specified TaskPane object. Security level 0.

The ViewInfos Collection

The ViewInfos collection contains ViewInfo objects that store information about each view in the form.

ViewInfos Collection Methods

The ViewInfos collection has no methods.

ViewInfos Collection Properties

The ViewInfos collection has two properties:

  • Count ” Read-only. A long integer value representing the number of ViewInfo objects in the ViewInfos collection. Security level 0.

  • Item ” Read-only. A reference to a specified ViewInfo object. Security level 0.

The Windows Collection

The Windows collection contains a Window object for each window in an InfoPath form.

Windows Collection Methods

The Windows collection has no methods.

Windows Collection Properties

The Windows collection has two properties:

  • Count ” Read-only. A long integer indicating the number of Window objects in the Windows collection. Security level 0.

  • Item ” Read-only. A specified Window object. Security level 0.

The XDocuments Collection

The XDocuments collection contains XDocument objects that each represent an InfoPath form that is open in the InfoPath client.

XDocuments Collection Methods

The XDocuments collection has four methods:

  • Close() ” Closes a specified InfoPath form. Security level 2.

  • New() ” Creates a new form based on the form specified in its argument. The argument is a URL indicating the location of an InfoPath form. Security level 2.

  • NewFromSolution() ” Creates a new form based on the form template ( .xsn file) specified in the method's argument. The argument is a string containing a URL that specifies the form template's location. Security level 2.

  • Open() ” Opens a specified form. The argument is a string containing a URL that indicates the location of the form ( .xml file). Security level 2.

XDocuments Collection Properties

The XDocuments collection has two properties:

  • Count ” Read-only. A long integer value indicating the number of XDocument objects in the XDocuments collection. Security level 2.

  • Item ” A reference to a specified XDocument object. Security level 0.

The XMLNodes Collection

The XMLNodes collection is a collection of XML DOM nodes. The XMLNodes collection is returned by the GetSelectedNodes() or GetContextNodes() method of the View object.

XMLNodes Collection Methods

The XMLNodes collection has no methods.

XMLNodes Collection Properties

The XMLNodes collection has two properties:

  • Count ” Read-only. A long integer value that indicates the number of nodes in the XMLNodes collection. Security level 0.

  • Item ” A reference to a specified node in the XMLNodes collection. Security level 0.

 <  Day Day Up  >  


Microsoft Office InfoPath 2003 Kick Start
Microsoft Office InfoPath 2003 Kick Start
ISBN: 067232623X
EAN: 2147483647
Year: 2004
Pages: 206

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net