Skip to content

Instantly share code, notes, and snippets.

@fabrizioc1
Created February 28, 2012 19:12
Show Gist options
  • Save fabrizioc1/1934450 to your computer and use it in GitHub Desktop.
Save fabrizioc1/1934450 to your computer and use it in GitHub Desktop.
Automating Outlook Out Of Office
##
## This script uses OLE automation to set the out of office message at a given date
##
require 'win32ole'
outlook = WIN32OLE.new('MAPI.Session')
outlook.Logon 'Outlook'
puts "Out of Office = #{outlook.OutOfOffice}"
outlook.OutOfOffice = true
outlook.Logoff
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment