Freigeben über


PrintForm.DocumentName Property

Gets or sets the document name to display (for example, in a print status dialog box or printer queue) while printing the document.

Namespace:  Microsoft.VisualBasic.PowerPacks.Printing
Assembly:  Microsoft.VisualBasic.PowerPacks.Vs (in Microsoft.VisualBasic.PowerPacks.Vs.dll)

Syntax

'Declaration
<BrowsableAttribute(True)> _
Public Property DocumentName As String
    Get
    Set
[BrowsableAttribute(true)]
public string DocumentName { get; set; }
[BrowsableAttribute(true)]
public:
property String^ DocumentName {
    String^ get ();
    void set (String^ value);
}
[<BrowsableAttribute(true)>]
member DocumentName : string with get, set
function get DocumentName () : String
function set DocumentName (value : String)

Property Value

Type: System.String
A String to display while printing the document. The default is "document".

Remarks

The DocumentName property does not specify the file to print. Rather, you specify the output to print by calling Print method.

Examples

The following example shows how to use the DocumentName property to display the document name while printing. This example requires that you have a PrintForm component named PrintForm1 on a form.

' Print to a printer. 
PrintForm1.PrintAction = Printing.PrintAction.PrintToPrinter
' Assign a document name.
PrintForm1.DocumentName = "Quarterly Results Graph"
' Send to the printer.
PrintForm1.Print()

.NET Framework Security

See Also

Reference

PrintForm Class

Microsoft.VisualBasic.PowerPacks.Printing Namespace

Other Resources

PrintForm Component (Visual Basic)

How to: Print a Form by Using the PrintForm Component (Visual Basic)

How to: Print the Client Area of a Form (Visual Basic)

How to: Print Client and Non-Client Areas of a Form (Visual Basic)

How to: Print a Scrollable Form (Visual Basic)

Deploying Applications That Reference the PrintForm Component (Visual Basic)