I've followed a solution found at superuser for capturing the unique identifier (UID) of an Outlook message stored in a PST file, and creating a org link of the form:

[[outlook:UID][Message subject]]

Selecting this link in emacs opens the message in Outlook using a little Lisp stored as org-outlook.el in my .emacs.d/lisp directory, so I can access specific messages right from org. Really nice solution for integrating emails that I need to reference right from my notes.

The problem is that I also like to export my notes as html using org-html-export through C-c C-e h o, but the Outlook links get rendered as:

<a href="UID">Message subject</a>

which tries (and fails, of course) to open a local file named "UID" instead of:

<a href="outlook:UID">Message subject</a>

which my browser correctly passes off to Outlook.

Is there a way for me to custom define the link export format for an outlook: link? Kinda a newbie here, and I couldn't find anything on the topic.


  • Are you using org-add-link-type or org-link-set-parameters in org-outlook.el? The former is deprecated in recent versions of org-mode.
    – NickD
    Oct 2, 2017 at 22:02
  • @Nick - the author of org-outlook.el -- posted a few years back in response to a question on superuser -- used org-add-link-type, which, as for as I saw in the org manual did not have an export: function. So glad you pointed me to the revised capability of org-link-set-parameters - that was the ticket! - I revised org-outlook.el to use follow: and export: and it works like a champ. Thank you so much!
    – kwoodham
    Oct 3, 2017 at 19:27
  • Actually, org-add-link-type takes a second optional argument called export, so you might have been able to do it with that, but it's certainly better to change it to the modern idiom.
    – NickD
    Oct 3, 2017 at 20:51

1 Answer 1


See comment from @Nick

For anyone interested; I modified org-outlook.el from what is shown at superuser to be:

;; old: 
;; (org-add-link-type "outlook" 'org-outlook-open)

;; new:
 :follow (lambda (path) (org-outlook-open path))
 :export (lambda (path desc backend)
            ((eq 'html backend)
             (format "<a href=\"outlook:%s\">%s</a>" path desc)))))

Thanks again for the hint from @Nick - not sure how to give him credit for the answer since he provided feedback in a comment.

  • You have given me more than enough credit, given that you did all the work! You might want to add a pointer in the superuser question pointing back to this - and if there is an upstream repo for org-outlook.el, maybe open an issue, pointing back to your solution.
    – NickD
    Oct 3, 2017 at 20:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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