From: Chuankai Lin Date: 2008-06-16T00:20:28+09:00 Subject: Re: How to get 'NewMail' event from Outlook The answer is found by my friend. The script below works on my windows box: ========================================= require 'win32ole' ol = WIN32OLE.new('Outlook.Application') #puts ol.Explorers.Item(1) #puts ol.ActiveExplorer.CurrentFolder.UnReadItemCount ev = WIN32OLE_EVENT.new(ol, 'ApplicationEvents') puts ol.GetNamespace("MAPI").GetDefaultFolder(6).UnReadItemCount ev.on_event("NewMail") { puts 'NewMail!' } loop { WIN32OLE_EVENT.message_loop } ========================================= Florian Gilcher wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > > On Jun 12, 2008, at 2:43 AM, Chuankai Lin wrote: > >> >> k = gets >> >> ================================================= > > I don't know you system, but what should k = gets do? This usually > lets you script wait for input on $stdin (whatever that may be). This > is no way to set you script into "waiting mode"! > > Regards, > Florian Gilcher > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.8 (Darwin) > > iEYEARECAAYFAkhRY60ACgkQJA/zY0IIRZYPYgCgkSRA2FD4KcMhV+a7qj4k04gM > 02kAnRyVptkRJgTffgDO5MQJYdczK657 > =cckK > -----END PGP SIGNATURE----- -- Posted via http://www.ruby-forum.com/.