XmlForm.Uri Property

Gets the Uniform Resource Identifier (URI) of a form.

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

Property Value

The Uniform Resource Identifier (URI) of the form.

The value returned by the Uri property can be passed as the name of a form when it is accessed from the XmlFormCollection collection.

Depending on the state of the form, the Uri property will return a different value as described in the following table.

Previewing a form

(Preview) formname

New form

formname

Previously saved form

The full URL of the form, which can be a path name (C:\My Documents\MyForm.xml) or a valid URL if the form template was published to SharePoint, a Web server, Microsoft Office Forms Server 2007, or Microsoft Office SharePoint Server 2007 with InfoPath Forms Services.

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, the Uri property of the XmlForm class is used to display a form's URI in a message box.

MessageBox.Show(this.Uri);

Community Additions

Show: