From: Chuankai Lin Date: 2008-06-12T09:43:58+09:00 Subject: How to get 'NewMail' event from Outlook Hi, I wrote the this script to get the 'NewMail' event from Outlook ================newmail.rb======================= require 'win32ole' ol = WIN32OLE.new('Outlook.Application') ev = WIN32OLE_EVENT.new(ol, 'ApplicationEvents') ev.on_event("NewMail") { puts 'NewMail!' } k = gets ================================================= But when I ran the script and tried to send a mail to myself, the outlook hung. If I terminate my ruby program, then the outlook comes back. The script seems to affect the execution of outlook. Does anyone have any idea? Is there anything wroing in my code. Thanks for your time. BR, cklin -- Posted via http://www.ruby-forum.com/.