Export Method

Microsoft Office InfoPath

Exports the view to a file of the specified format.

expression.Export(ByVal bstrURL As String, ByVal bstrFormat As String)

expression    Required. An expression that returns a reference to the View object.

bstrURL Required String. The directory location that the exported view file will be written to.

bstrFormat Required String. The type of file format to export to. Only the "MHT" value is supported.

Security Level

3: Can be accessed only by fully trusted forms.

Remarks

If used in a form that is not fully trusted, the Export method will return a "permission denied" error.

Example

In the following example, the Export method of the View object is used to export the current view:

XDocument.View.Export("C:\\MyView", "MHT");