= pd.nFromPage
        ToPage = pd.nToPage
        PrintToFile = (pd.flags And PD_PRINTTOFILE)
        ' Get DEVMODE structure from PRINTDLG
        
        Dim pDevMode As Long
        pDevMode = GlobalLock(pd.hDevMode)
        CopyMemory m_dvmode, ByVal pDevMode, Len(m_dvmode)
        GlobalUnlock pd.hDevMode
        If (pd.flags And PD_COLLATE) = PD_COLLATE Then
            ' User selected collate option but printer driver
            ' does not support collation.
            ' Collation option must be 