Format.CancelPrinting Function |
Displays a prompt that either cancels printing, or allows user to cancel printing.
Format.CancelPrinting(Message, ContinueButtonLabel)
Where:
Message is a string containing the text of the prompt dialog.
ContinueButtonLabel is an optional string containing the name of the "Continue" button.
The Format.CancelPrinting function displays a prompt that allows the user to cancel the print job manually.Alternatively, this function can display a prompt that simply informs the user that the print job is cancelled.If ContinueLabelButton is null (""), the user cannot prevent the cancellation of the print job and the message has only an OK button.If ContinueLabelButton is omitted from the Format.CancelPrinting function, the resulting dialog contains a Cancel button, as well as a Continue button.If ContinueLabelButton is present and not null, it specifies the label of the second button.
The following example demonstrates the Format.CancelPrinting function in use.The code checks the number of serialized labels.
If Format.NumberSerializedLabels > 1000 Then
Call Format.CancelPrinting("Too Many Labels.Job is being cancelled.", "")
ElseIf Format.NumberSerializedLabels > 500 AND Format.NumberSerializedLabels < 1000 Then
Call Format.CancelPrinting("500-1000 Labels.Do you want to cancel?", "Print Anyway")
End If