# Export Method

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");

©2003-2004 Microsoft Corporation. All rights reserved. Permission to copy, display and distribute this document is available at: http://msdn.microsoft.com/library/en-us/odcXMLRef/html/odcXMLRefLegalNotice.asp