Prints the form content as it is rendered in the window corresponding to the form's active view.
expression.PrintOut()
expression Required. An expression that returns a reference to an XDocument object.
3: Can be accessed only by fully trusted forms.
The PrintOut method uses the current printer settings. Returns a permission denied error if called from a form that is not fully trusted.
It is recommended that you don't call the PrintOut method from an OnLoad or OnSwitchView event procedure. You may encounter one or more of the following behaviors when calling the PrintOut method from an OnLoad or OnSwitchView event procedure:
Invalid context for the OM call.
In the following example, the PrintOut method of the XDocument object is used to print the current view:
XDocument.PrintOut();