5

I would like to integrate the calendar from my outlook into my orgmode agenda.

I am looking for a solution with the following features

  • Should be implemented in elisp only, so that I can run this on any system that has emacs
  • Should use Microsoft Exchange EWS Webservices to retrieve the calendar items.
  • Should create an org file containing the items for a predefined period (i.e. next two weeks or similar...)
  • Should be compatible with Office 365

I found some solutions, that come close, but are not quite there.

  • The ews-orgmode solution (see https://github.com/kautsig/ews-orgmode). This is implemented in python and generates an org file. This is problematic, because this obviously requires a python implementation and a scheduling solution. This makes this hard to use across platforms (e.g. windows vs linux) and requires significant effort to set up.

  • excorporate (see https://github.com/emacsmirror/excorporate). This is implemented in elisp, but does not provide any orgmode integration. I can create a buffer containing the calendar entries for a specific date, but cannot integrate it into the org agenda, because the buffer is not persisted and I am not aware of any way to call excorporate on agenda creation (with a specific date or date range) and to show those entries in the agenda

Is there any way to achieve an exchange calendar integration into the agenda using excorporate or something similar?

3

I solved this myself using excorporate. To activate and integrate excorporate I used the following configuration in my .spacemacs (since I am using spacemacs)

I added excorporate to dotspacemacs-additional-packages and added the following to the user-config section of .spacemacs

   ;; configure excorporate
   ;; allow opening the exchange calendar with 'e' from calendar 
   (evil-define-key 'motion calendar-mode-map "e" #'exco-calendar-show-day)

   (setq-default
    ;; configure email address and office 365 exchange server adddress for exchange web services
    excorporate-configuration
     (quote
      ("my.email@myorg.com" . "https://outlook.office365.com/EWS/Exchange.asmx"))
     ;; integrate emacs diary entries into org agenda
     org-agenda-include-diary t
     )
   ;; activate excorporate and request user/password to start connection
   (excorporate)
   ;; enable the diary integration (i.e. write exchange calendar to emacs diary file -> ~/.emacs.d/diary must exist)
   (excorporate-diary-enable)
   (defun ab/agenda-update-diary ()
     "call excorporate to update the diary for today"
     (exco-diary-diary-advice (calendar-current-date) (calendar-current-date) #'message "diary updated")
     )

   ;; update the diary every time the org agenda is refreshed
   (add-hook 'org-agenda-cleanup-fancy-diary-hook 'ab/agenda-update-diary )

With this configuration, the exchange calendar is added to the emacs diary and the diary is integrated into the orgmode agenda. The exchange calendar is update every time my agenda is refreshed.

Only the exchange calendar for today is added to the diary.

If I want to see the calendar for a different day, I use the calendar, navigate to the desired date and press 'e'. The appointment for that day are then displayed in a orgmode formatted buffer

The user and password for the exchange server is requested on emacs startup..

Final Note: Excorporate only seems to work with Office365, if outlook webaccess is open

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.