ags = afFlags And Not PD_ENABLESETUPTEMPLATE
        
    ' Fill in PRINTDLG structure
    Dim pd As TPRINTDLG
    pd.lStructSize = Len(pd)
    pd.hWndOwner = Owner
    pd.flags = afFlags
    pd.nFromPage = FromPage
    pd.nToPage = ToPage
    pd.nMinPage = 1
    pd.nMaxPage = &amp;HFFFF
    If (Hook) Then
        'HookedDialog = Me
        'Set m_oEventSink = EventSink
        If (pd.flags And PD_PRINTSETUP) = PD_PRINTSETUP Then
            'pd.flags = pd.flags Or PD_ENABLESETUPHOOK
            'pd.lpfnSet