From: Joel Pearson Date: 2013-03-11T06:59:09+09:00 Subject: Re: Question regarding automating some Outlook/IMAP and pdf parsing functions w/ ruby? unknown wrote in post #1100964: > Am 10.03.2013 19:26, schrieb sto.mar@web.de: >>> block. >> >> `rescue false' will rescue nearly all exceptions that might occur, which >> is a potentially dangerous thing. Better use a begin/rescue/end block. > > I did not follow the start of the thread, but probably even better > in this case would be to use `respond_to?' instead of relying on > exceptions. These are valid points, specific error trapping is good, and avoiding errors even better. Unfortunately I haven't been able to get "respond_to?" working with ole methods, so it'll have to be rescue. Can't do a single line rescue with a specific class... if ( begin msg.Senderemailaddress =~ /@exampledomain.com$/i rescue NoMethodError false end ) && This link shows how to get specific folders (users) in outlook. http://rubyonwindows.blogspot.com.ar/2008/01/rubygarden-archives-scripting-outlook.html -- Posted via http://www.ruby-forum.com/.