XDocuments Collection


XDocuments Collection

The XDocuments collection contains an object for each of the currently open InfoPath forms. Each object references an underlying XML document. The properties and methods of this collection are shown in Table A.6.

Table A.6: Properties and Methods of The XDocuments Collection.

Name

Security Level

Description

New Method

2

Creates a new form using the existing data of a form. This is not used to create a new form based on an existing form template.

Close Method

2

Unconditionally closes the open form and doesn t save any of the existing or changed data.

NewFromSolution Method

2

Creates a new form based on an existing form template.

Open Method

2

Opens a specified form for data entry.

Count Property

N/A

Returns the total number of XDocument objects contained in the current collection.

Item Property

N/A

Returns a reference to the specified XDocument object.

The following example uses the NewFromSolution method to pass the URI of an existing solution; a new form is created and the associated XDocument object is returned:

 var objFormSolution; objFormSolution = Application.XDocuments.NewFromSolution("c:\Employee.xsn") 

The New method is called to pass the URI of an existing form, as shown here:

 var objFormInfo; objFormInfo = Application.XDocuments.New("C:\Employee.xml"); 



Programming Microsoft Infopath. A Developers Guide
Programming Microsoft Infopath: A Developers Guide
ISBN: 1584504536
EAN: 2147483647
Year: 2006
Pages: 111
Authors: Thom Robbins

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