Share via


XmlForm.Submit method

Submits the form using the submit operation defined in the form template.

Namespace:  Microsoft.Office.InfoPath
Assembly:  Microsoft.Office.InfoPath (in Microsoft.Office.InfoPath.dll)

Syntax

'Declaration
Public MustOverride Sub Submit
'Usage
Dim instance As XmlForm

instance.Submit()
public abstract void Submit()

Exceptions

Exception Condition
WebException

The form cannot be submitted.

InvalidOperationException

The Submit method was called from the Loading event.

Remarks

Using the Submit method is similar to, but not exactly like, using the submit operation from the InfoPath user interface. Calling the Submit method simply performs the submit operation, but the submit operation must first be defined for form template in design mode.

Note

You can write a custom submit event handler for the Submit event, and then you can programmatically call the event handler by using the Submit method.

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 InfoPath Filler or in a Web browser.

Examples

In the following code example, the Submit method of the XmlForm class is used to submit the form using the predefined submit operation.

this.Submit();
Me.Submit()

See also

Reference

XmlForm class

XmlForm members

Microsoft.Office.InfoPath namespace