We recommend using Visual Studio 2017

LoadingEventArgs.InputParameters Property

Gets an IDictionary containing any input parameters specified using the /InputParameters command-line option, or specified using query parameters in a URL.

Namespace: Microsoft.Office.InfoPath
Assembly: Microsoft.Office.InfoPath (in microsoft.office.infopath.dll)

Property Value

An IDictionary containing input parameters.

Exception typeCondition


A method was called which attempted to write to the IDictionary containing input parameters.

Input parameters consist of one or more name/value pairs separated by the ampersand (&) character that are specified when a form template is opened from the command line or a batch file using the /InputParameters command-line option. Input parameters can also be specified using query parameters when a form template is opened from a URL.


While an IDictionary is normally read/write, InfoPath prevents calls to any methods that write to the IDictionary (such as the Add or Clear methods). Any attempts to make calls that write to the IDictionary returned by the InputParameters property will throw an InvalidOperationException.

This member can be accessed only by forms running in the same domain as the currently open form, or by forms that have been granted cross-domain permissions.

This type or member can be accessed from code running in forms opened in Microsoft Office InfoPath 2007 or in a Web browser.

In the following example, an InfoPath form template is opened from either the command line or URL using the following syntax.


infopath.exe "C:\User Forms\DeptReport.xsn" /InputParameters "Dept=Accounting"



The InputParameters property is used from a Loading event handler to set the Department field value to the value "Accounting" which was passed using the /InputParameters command-line option or URL input parameter.

public void FormEvents_Loading(object sender, LoadingEventArgs e)
   string vDept = e.InputParameters["Dept"];

   XPathNavigator myNav = CreateNavigator();