Microsoft Office InfoPath 2003 supports the use of a number of command-line options. These command-line options can be used to perform a variety of tasks in InfoPath when the program starts, such as opening a new form, setting the default location for saved forms, merging forms, and opening a form template (form template: In InfoPath, a file or set of files that defines the data structure, appearance, and behavior of a form.) in design mode.
To customize how InfoPath starts, do the following:
- Open the MS-DOS prompt.
- At the command prompt in the Command Prompt window, switch to the disk drive and directory that contains the InfoPath.exe file — for example C:\Program Files\Microsoft Office\OFFICE11\.
- At the command prompt, type InfoPath.exe, followed by a space and the command-line option and values that you want to use.
The following table describes each of the InfoPath command-line options.
||Opens a new form based on an existing form or form template, without automatically setting the default location for saved files. Also adds the form to the list of most recently used files. If no form or form template is specified, InfoPath starts without loading a form. The name of the form or form template can be a file name, a fully-qualified path and file name, or a Uniform Resource Name (URN) (Uniform Resource Name (URN): A scheme for uniquely identifying resources that may be available on the Internet by name, without regard to where they are located.). You can also use this option with the /defaultsavelocation option.
||Sets the specified URL as the search path for the Save As dialog box the first time the form is saved. The /defaultsavelocation option is disregarded unless the /new option is also specified. Any necessary character encoding of the URL must be done by the caller.
|/aggregate <form1|form2|form3> <form|formtemplate>
||Merges the specified forms into a single form. Individual form names in the form list should not be enclosed by quotation marks, but the entire form list can be enclosed by quotation marks. The form names must be separated by a pipe (|) character. The form or form template used to perform the merge must also be specified. If a form (.xml file) is specified, InfoPath opens the form in edit mode and then merges the data into that form. If a form template (.xsn file) is specified, InfoPath begins the merge by using a new form based on the form template.
||Opens the specified form template in design mode. If no form template is specified, InfoPath starts in design mode, and no file is opened. If a form (.xml file) is specified, the form opens in edit mode.
||Starts InfoPath without displaying a window.
||Starts InfoPath without automatically displaying the Fill Out a Form dialog box.
||Clears the cache in which form templates are stored on the computer.
Note InfoPath also supports opening forms and form templates by using no options on the command line. If you specify a form name, the form is opened for editing; if you specify a form template name, a new form that is based on the form template is opened.
In this example, the /new option is used to open a new form and set the default location for saved files:
InfoPath.exe /new "MyForm.xml" /defaultsavelocation "C:\MyForms"
In this example, the /aggregate option is used to merge the XML data from two forms into one that is based on the specified form template:
InfoPath.exe /aggregate "MyForm1.xml|MyForm2.xml" "MyForm.xsn"
In this example, the /design option is used to open a form template in design mode:
InfoPath.exe /design "MyForm.xsn"