ExternalApplication Object

Microsoft Office InfoPath

Show All Show All

ExternalApplication Object

ExternalApplication

Represents the Microsoft Office InfoPath 2003 application. The ExternalApplication object implements a limited set of methods that can be used for automating InfoPath by an external Component Object Model (COM)–based programming language.

Remarks

The ExternalApplication object can be used to perform a limited set of InfoPath operations such as creating, opening, or closing a form; registering or unregistering a form template; or simply quitting the application.

Using the ExternalApplication object

To use the ExternalApplication object, you must first create a reference to it using the ProgID of the InfoPath object model along with the name of the ExternalApplication object. The following example demonstrates creating a reference to the ExternalApplication object using the Visual Basic for Applications (VBA) programming language:

    Dim objIP As Object
Set objIP = CreateObject("InfoPath.ExternalApplication")
  

Note  This example uses late-binding for creating the reference to the ExternalApplication object; you can also use early-binding by setting a reference to the InfoPath object model in your programming environment.

After you have created a reference to the ExternalApplication object, you can then use the methods that it provides to interact with InfoPath. In the following example, written in VBA, the Open method of the ExternalApplication object is used to open a form based on the specified Uniform Resource Identifier (URI):

    Public Sub OpenForm()

   Dim objIP As Object

   'Create the ExternalApplication object and open a specified form.
   Set objIP = CreateObject("InfoPath.ExternalApplication")
   objIP.Open ("C:\My Forms\Form1.xml")

   Set objIP = Nothing

End Sub

  

For more information about using the ExternalApplication object, see Automating InfoPath.