fork download
  1. require 'win32ole'
  2.  
  3. def print_size
  4. namespace = WIN32OLE.connect('Outlook.Application').GetNameSpace('MAPI')
  5.  
  6. # "あなたのアカウント名" ってのは例えば、"xxxx@gmail.com"
  7. # Outlook開いたら左のペインにそういう文言あるでそ
  8. target_folder = namespace.Folders["あなたのアカウント名"].Folders["受信トレイ"]
  9.  
  10. target_folder.Items.each {|mail|
  11. # Rubyist MagagineにGC.statしないとダメなときあるとか書いてたんで試してみては
  12. # 250件ないんで検証はここまでしかできないわ orz
  13. #
  14. # http://m...content-available-to-author-only...t.net/?0007-Win32OLE
  15. GC.start
  16. p mail.size
  17. }
  18.  
  19. end
  20.  
  21. print_size
  22.  
Runtime error #stdin #stdout #stderr 0s 28688KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
prog.rb:1:in `require': cannot load such file -- win32ole (LoadError)
	from prog.rb:1:in `<main>'