emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Orgmode] Org Babel, Ruby and Outlook


From: Miguel Fernando Cabrera
Subject: [Orgmode] Org Babel, Ruby and Outlook
Date: Thu, 15 Oct 2009 17:47:01 -0500

Hi All,

In a similar way to  [1],  I want to import my Outlook appointments into Org. I thought of a less sophisticated way to archive this using Org Babel.
I coded a Ruby script to "print out"  the Appointments in Org Format so I can see them in the agenda view.  I execute the code using the ":results output" header option to get the output from the ruby script (check the script below).

Now, the only problem is that the output of the script is always surrounded by  #+begin_example and #+end_example. I was wondering if there is a way to prevent this. What I want is  the text lines to be put on the Org buffer so Org can interpret them as headlines.

Also, I tried to get the output using a vector (value mode), but for some reason I was getting "End of File During Parsing" message when executing the script. I think it has to be with some characters in the Subject properties of the Outlook appointments.

Any help will be really appreciated.

[1] http://osdir.com/ml/emacs-orgmode-gnu/2009-04/msg00264.html

-----------------------------------------------------------------------------------------------------------------

#+begin_src ruby :results output
  require 'win32ole'
 
  def to_org_date(otStr)
    "<%s>" % otStr.gsub("/","-")
  end
 
  def to_org_interval(start,endd)
    to_org_date(start)+"--"+to_org_date(endd)
  end
 
  outlook = WIN32OLE.new('Outlook.Application')
 
  mapi = outlook.GetNameSpace('MAPI')
  calendar = mapi.GetDefaultFolder(9)
  puts "* OUTLOOK APPOINTMENTS"
  calendar.Items.each do |appt|
    puts "** #{appt.Subject}\n #{to_org_interval(appt.Start,appt.End)} "
  end
#+end_src

------------------------------------------------------------------------------------------------------------


--
Miguel Fernando Cabrera Granados
http://mfcabrera.com
"A los hombres fuertes les pasa lo que a los barriletes; se elevan cuando es
mayor el viento que se opone a su ascenso." - José Ingenieros

reply via email to

[Prev in Thread] Current Thread [Next in Thread]