The Application Object

 <  Day Day Up  >  

The Application Object

The Application object represents the InfoPath application.

Application Object Methods

The Application object has four methods:

  • FormatString() ” Formats a string according to the method's arguments. Security level 0.

  • NewADODBConnection() ” Creates and returns a new ADO Connection object. Security level 3.

  • NewADODBRecordset() ” Creates and returns a new ADO Recordset object. Security level 3.

  • Quit() ” Security level 3.

The Quit() Method

The Quit() method is security level 3 and has a single boolean argument, which refers to whether the user is given the opportunity to save changes before InfoPath is closed. To close InfoPath without giving the user the option to save, use Application.Quit(false) . In the initial release of InfoPath, the Application.Quit(true) option does not produce the expected prompt to the user.

If a user attempts to use the Quit() method in a form template that is not fully trusted, a "Permission Denied" error message is displayed.

The ApplicationQuit.xsn form template demonstrates the Application.Quit() method. The Application.Quit() method is security level 3, so you must have a fully trusted form template to use it. The ApplicationQuit.msi installer provided in the download installs the form template to c:\Program Files\QuitExample .

Application Object Properties

The Application object has six properties:

  • ActiveWindow ” Read-only. A reference to the Window object that represents the current window.

  • LanguageSettings ” Read-only. A reference to the Office LanguageSettings object.

  • Name ” The name of the Application object.

  • Version ” The version of the Application object.

  • Windows ” Read-only. A reference to the Windows collection.

  • XDocuments ” Read-only. A reference to the XDocuments collection.

The form template ApplicationProperties.xsn demonstrates the use of some of the Application object properties.

 <  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