 End If
    End If
    
    ' Show Print dialog
    m_lApiReturn = PrintDlg(pd)
    'ClearHookedDialog
    Set m_oEventSink = Nothing
    Select Case m_lApiReturn
    Case 1
        VBPrintDlg = True
        ' Return dialog values in parameters
        hdc = pd.hdc
        If (pd.flags And PD_PAGENUMS) Then
            PrintRange = eprPageNumbers
        ElseIf (pd.flags And PD_SELECTION) Then
            PrintRange = eprSelection
        Else
            PrintRange = eprAll
        End If
        FromPage 