Edit

Share via


XmlForm.Print Method

Definition

Overloads

Print()

Prints the form content as it is rendered in the form's active view.

Print(Boolean)

Prints the form content as it is rendered the form's active view by displaying the Print dialog box.

Print()

Prints the form content as it is rendered in the form's active view.

public:
 abstract void Print();
public abstract void Print ();
abstract member Print : unit -> unit
Public MustOverride Sub Print ()

Exceptions

The form cannot be printed.

The Print method was called from the Loading event.

The form template is not configured for Full Trust using the Security and Trust category of the Form Options dialog box.

Examples

In the following code example, the Print method of the XmlForm class is used to print the current view using the current printer settings.

this.Print(); Me.Print()

Remarks

The Print method uses the current printer settings, and raises exceptions if the method was called from event handlers for the ViewSwitched or Loading events, or is called from a form that is not fully trusted.

This member can be accessed only by forms opened from a form template that has been configured to run with full trust using the Security and Trust category of the Form Options dialog box. This member requires full trust for the immediate caller and cannot be used by partially trusted code. For more information, see "Using Libraries from Partially Trusted Code" on MSDN.

This type or member can be accessed only from code running in forms opened in Microsoft InfoPath Filler.

Applies to

Print(Boolean)

Prints the form content as it is rendered the form's active view by displaying the Print dialog box.

public:
 abstract void Print(bool showPrintDialog);
public abstract void Print (bool showPrintDialog);
abstract member Print : bool -> unit
Public MustOverride Sub Print (showPrintDialog As Boolean)

Parameters

showPrintDialog
Boolean

Set to true to display the Print dialog box to allow the user to configure where and how to print the form. When set to false, the form is printed on the default printer.

Exceptions

The form cannot be printed.

The Print method was called from the Loading event.

The parameter passed to this method is a null reference (Nothing in Visual Basic).

The parameter passed to this method is not valid. For example, it is of the wrong type or format.

The form template is not configured for Full Trust using the Security and Trust category of the Form Options dialog box.

Examples

In the following code example, the Print (showPrintDialog) method of the XmlForm class is used to print the current view by displaying the Print dialog box.

this.Print(true); Me.Print(True)

Remarks

The Print (showPrintDialog) method raises exceptions if the method was called from event handlers for the ViewSwitched or Loading events, or is called from a form that is not fully trusted.

This member can be accessed only by forms opened from a form template that has been configured to run with full trust using the Security and Trust category of the Form Options dialog box. This member requires full trust for the immediate caller and cannot be used by partially trusted code. For more information, see "Using Libraries from Partially Trusted Code" on MSDN.

This type or member can be accessed only from code running in forms opened in Microsoft InfoPath Filler.

Applies to