Skip to content

Instantly share code, notes, and snippets.

@webframp
Created September 7, 2012 13:56
Show Gist options
  • Save webframp/3666453 to your computer and use it in GitHub Desktop.
Save webframp/3666453 to your computer and use it in GitHub Desktop.
Directly link to Outlook 2007 email from emacs org-mode
;;; org-outlook.el - Support for links to Outlook items in Org
;; via: http://superuser.com/questions/71786/can-i-create-a-link-to-a-specific-email-message-in-outlook
;;
;; use (require 'org-outlook) in init.el
(require 'org)
(org-add-link-type "outlook" 'org-outlook-open)
(defun org-outlook-open (id)
"Open the Outlook item identified by ID. ID should be an Outlook GUID."
(w32-shell-execute "open" (concat "outlook:" id)))
(provide 'org-outlook)
;;; org-outlook.el ends here
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\outlook]
"URL Protocol"=""
@="URL:Outlook Folders"
[HKEY_CLASSES_ROOT\outlook\DefaultIcon]
@="C:\\PROGRA~1\\MICROS~3\\OFFICE12\\OUTLLIB.DLL,-9403"
[HKEY_CLASSES_ROOT\outlook\shell]
@="open"
[HKEY_CLASSES_ROOT\outlook\shell\open]
@=""
[HKEY_CLASSES_ROOT\outlook\shell\open\command]
@="\"C:\\PROGRA~1\\MICROS~3\\OFFICE12\\OUTLOOK.EXE\" /select \"%1\""
'Adds a link to the currently selected message to the clipboard
Sub AddLinkToMessageInClipboard()
Dim objMail As Outlook.MailItem
Dim doClipboard As New DataObject
'One and ONLY one message muse be selected
If Application.ActiveExplorer.Selection.Count <> 1 Then
MsgBox ("Select one and ONLY one message.")
Exit Sub
End If
Set objMail = Application.ActiveExplorer.Selection.Item(1)
doClipboard.SetText "[[outlook:" + objMail.EntryID + "][MESSAGE: " + objMail.Subject + " (" + objMail.SenderName + ")]]"
doClipboard.PutInClipboard
End Sub
@calebhailey
Copy link

You solved your problem? :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment