| How to Specify Num of Copies w/ Common Dialog or Escape() APIID: Q78165 
 | 
You can use the Common Dialog in the Professional Edition of Visual Basic version 2.0 or 3.0, or you can call the Windows API Escape() function in other versions to tell the Windows Print Manager how many copies of a document you want to print.
The Windows API constant SETCOPYCOUNT (value 17) can be used as an
argument to the Escape() function to specify the number of uncollated
copies of each page for the printer to print.
The arguments for Escape() are as follows:
r% = Escape(hDC, SETCOPYCOUNT, Len(Integer), lpNumCopies, lpActualCopies) 
Parameter          Type/Description
--------------------------------------------------------------------
hDC                hDC. Identifies the device context. Usually
                   referenced by Printer.hDC.
lpNumCopies        Long pointer to integer (not ByVal). Point to a
                   short-integer value that contains the number of
                   uncollated copies to print.
lpActualCopies     Long pointer to integer (not ByVal). Points to a
                   short integer value that will receive the number of
                   copies that where printed. This may be less than
                   the number requested if the requested number is
                   greater than the device's maximum copy count. 
' The following Declare statement must be typed on one, single line:
Declare Function Escape% Lib "GDI" (ByVal hDc%, ByVal nEsc%, ByVal nLen%,
   lpData%, lpOut%)
REM   Below is the click procedure for a command button on Form1:
Sub Command1_Click ()
   Const SETCOPYCOUNT = 17
      Printer.Print ""
      x% = Escape(Printer.hDC, SETCOPYCOUNT, Len(I%), 3, actual%)
      Printer.Print " Printing three copies of this"
      Printer.EndDoc
End Sub Additional query words: 2.00 3.00
Keywords          : 
Version           : 
Platform          : 
Issue type        : Last Reviewed: June 23, 1999