   PSD_EnablePageSetupTemplate)
    ' Set TPAGESETUPDLG flags
    afFlags = (-DisableMargins * PSD_DISABLEMARGINS) Or _
              (-DisableOrientation * PSD_DISABLEORIENTATION) Or _
              (-DisablePaper * PSD_DISABLEPAPER) Or _
              (-DisablePrinter * PSD_DISABLEPRINTER) _
               And afMask
    If (flags And PSD_Defaultminmargins) = PSD_Defaultminmargins Then
        afFlags = afFlags Or PSD_Defaultminmargins
    Else
        afFlags = afFlags Or PSD_MARGINS
    End If
    Dim l