'Called when ViewBrowse message is received'

def OnViewBrowse(self, id, code):

    from pywin.mfc import dialog
    from pywin.tools import browser
    obName = dialog.GetSimpleInput('Object', '__builtins__', 'Browse    Python    Object')
    if (obName is None):
        return
    try:
        browser.Browse(eval(obName, __main__.__dict__, __main__.__dict__))
    except NameError:
        win32ui.MessageBox('This    is    no    object    with    this    name')
    except AttributeError:
        win32ui.MessageBox('The    object    has    no    attribute    of    that    name')
    except:
        traceback.print_exc()
        win32ui.MessageBox('This    object    can    not    be    browsed')
