Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

Application Object

Office 2007
Represents the Microsoft Office InfoPath 2007 application.

Version Information
 Version Added:  InfoPath 2003

Remarks

The Application object includes properties and methods that return references to the high-level objects of the InfoPath object model. For example, the XDocuments property returns a reference to a collection of XDocument objects.

The Application object is the top-level object in the InfoPath object model, and it provides a number of properties and methods that can be used to access lower-level collections and objects in the object model, and to perform a variety of general purpose functions.

The Application object can be used directly in scripting code as in the following Microsoft JScript example, which uses the Alert method of the UI object, accessed through the XDocument object, to display a message box that indicates the version number of the current instance of InfoPath:

JScript
XDocument.UI.Alert("Application version: " + Application.Version);

Note that the XDocument property was not qualified with the name of the Application object. This is because both the Application object and the XDocument object are embedded directly in the InfoPath script engine, and therefore they do not have to be explicitly declared. However, they do need to be declared when used in an expression or argument, as the example above demonstrates.

Using the Application object

The Application object contains the following methods that can be used within InfoPath:

MethodDescription
FormatStringFormats the specified string or XML node according to the specified category and options parameters.
IsDestinationReachableReturns a Boolean value indicating whether the specified Uniform Resource Locator (URL), universal naming convention (UNC) path, or IP address of the destination computer can be connected to from the client computer.
NewADODBConnectionCreates and returns a reference to an empty ActiveX Data Objects (ADO) Connection object.
NewADODBRecordsetCreates and returns a reference to an empty ActiveX Data Objects (ADO) Recordset object.

The Application object contains the following methods that can be used for external automation:

MethodDescription
CacheSolutionExamines the form template in the cache and, if necessary, updates it from the published location of the form template.
QuitQuits the Microsoft Office InfoPath 2007 application.
RegisterSolutionInstalls the specified Microsoft Office InfoPath form template.
UnregisterSolutionUninstalls the specified Office InfoPath 2007 form template.

The XDocuments collection contains the following additional methods that can be used for external automation:

MethodDescription
CloseCloses the specified Office InfoPath 2007 form.
NewCreates a new Office InfoPath 2007 form based on the specified form.
NewFromSolutionCreates a new Office InfoPath 2007 form based on the specified form template.
NewFromSolutionWithDataCreates a new Office InfoPath 2007 form using the specified XML data and form template.
OpenOpens the specified Office InfoPath 2007 form.

Although the ExternalApplication object is deprecated, replaced with the methods in the above tables, ExternalApplication methods are still available for backward compatibility.

For more information about using the Application object, see Accessing application data.




Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.