Share via


CPrintDialog::PrintCollate

Determines whether collated copies are requested.

BOOL PrintCollate( ) const;

Return Value

Nonzero if the user selects the collate check box in the dialog box; otherwise 0.

Remarks

Call this function after calling DoModal to determine whether the printer should collate all printed copies of the document.

Example

// Display the Windows Print dialog box with Collate check box checked.
CPrintDialog dlg(FALSE, PD_ALLPAGES | PD_COLLATE | PD_NOPAGENUMS | 
   PD_HIDEPRINTTOFILE);
if (dlg.DoModal() == IDOK)
{
   // If the collate check box is selected, then GetCopies() will return 
   // the number of copies printed. Otherwise, GetCopies() always  
   // returns 1. Then, the number of copies printed can be found from the 
   // DEVMODE structure of the printing device. 
   if (dlg.PrintCollate())
   {
      int num = dlg.GetCopies();
      TRACE(_T("Number of copies printed = %d\n"), num);
   }
   else
   {
      LPDEVMODE devmode = dlg.GetDevMode();
      TRACE(_T("Number of copies printed = %d\n"), devmode->dmCopies);
   }
}

Requirements

Header: afxdlgs.h

See Also

Reference

CPrintDialog Class

Hierarchy Chart

CPrintDialog::GetCopies