From: gregarican Date: 2005-09-28T03:21:44+09:00 Subject: Re: Outlook calendar Whether you are working with Contact, Calendar, Tasks, etc. MAPI objects the Ruby code is the same. Here's an example that will give you the MAPI CDOPR_ENTRYID values for all calendar entries. In this case it's a Vacation Calendar out in the Public Folders: require 'win32ole' CDOPR_ENTRYID = 0x0FFF0102 # the MAPI property ID for Entry ID's # create the Exchange server session @session = WIN32OLE.new('Mapi.Session') @session.logon('Greg Kujawa') # navigate to the Sales Contacts entry underneath All Public Folders publicFolders = String.new recordCount = @session.InfoStores.count recordCount.times { |i| publicFolders = @session.InfoStores.Item(i+1).RootFolder.Folders if @session.InfoStores.Item(i+1).name == "Public Folders" } allPublicFolders = String.new recordCount = publicFolders.count recordCount.times { |i| allPublicFolders = publicFolders.Item(i+1).Folders if publicFolders.Item(i+1).name == "All Public Folders" } vacationCalendar = String.new recordCount = allPublicFolders.count recordCount.times { |i| vacationCalendar = allPublicFolders.Item(i+1).messages if allPublicFolders.Item(i+1).name == "Vacation Calendar" } recordCount = vacationCalendar.count recordCount.times { |i| p vacationCalendar.Item(i+1).Fields.Item(CDOPR_ENTRYID).value.to_s } For a listing off all of the MAPI property ID's check out http://www.cdolive.com/cdo10.htm. You will have to translate the VB some, as the &H0FFF0102 means 0x0FFF0102 or '0FFF0102'.hex. The trick (as I have mentioned) when pulling data is that any nil/null field values cause MAPI to return an error code. So you have to write a Ruby routine that will catch this error and simply return a nil/null field value instead of raising a runtime error. Does this help?