Control Reference > VSPrinter Control > VSPrinter Events > LoadingDoc Event |
Fired while loading documents from disk, once after each page is loaded.
Private Sub VSPrinter_LoadingDoc( ByVal Page As Integer, ByVal Of As Integer, Cancel As Boolean)
The parameters for the LoadingDoc event are described below:
Parameter |
Description |
Page |
The number of the page being loaded. |
Of |
The total number of pages to be loaded. |
Cancel |
Set this parameter to True if you wish to cancel the loading operation. |
If you want to allow the user to cancel the loading operation, you should include a call to DoEvents in this event handler. This will allow your application to process user actions while the document is loading (such as clicking a Cancel button or pressing the ESC key).
For example:
Private Sub vp_LoadingDoc(ByVal Page As Integer, _
ByVal Of As Integer, Cancel As Boolean)
' provide user feedback
Debug.Print "Loading Page "; Page; " of "; Of
' detect user actions
DoEvents
Cancel = bGlobalCancelFlag
End Sub