ComponentOne VSView 8.0
Step 4: Printing Files

Once the preview document has been created, printing it is very easy. All you need to do is call the PrintDoc method. To add the code, double-click on the Printcommand button and type the following;

Example Title
Copy Code
Private Sub cmdPrint_Click()

 

  ' if we have a document in memory, print it

  If vp.PageCount > 0 Then vp.PrintDoc

 

End Sub

Before printing the document, we do a check to make sure we have a document available for printing.

When the user clicks on the Print button, a progress dialog will appear showing which document is being printed on which printer, and the current page. The dialog has a Cancel button that allows the user to stop printing the document if he changes his mind.

If you don't want this dialog to appear, or want to provide your own dialog instead, set the AbortWindow property to False.

 

 


Copyright (c) GrapeCity, inc. All rights reserved.

Product Support Forum  |  Documentation Feedback