SiteMap Search ElispArea HowTo Glossary RecentChanges News Problems Suggestions
Cameroon, National Day

OrgOutlook

Library Information

org-outlook.el — Outlook org

Introduction:

Org mode lets you organize your tasks. However, sometimes you may wish to integrate org-mode with outlook since your company forces you to use Microsoft Outlook. org-outlook.el allows:

This is based loosely on: http://superuser.com/questions/71786/can-i-create-a-link-to-a-specific-email-message-in-outlook

Note that you may also add tasks using visual basic directly. The script below performs the following actions:

The visual basic script for outlook is:

Sub CreateTaskFromItem()
    Dim T As Variant
    Dim Outlook As New Outlook.Application
    Dim orgfile As Variant
    Dim Pos As Integer
    Dim taskf As Object
    
    Set myNamespace = Outlook.GetNamespace("MAPI")
    Set myPersonalFolder = myNamespace.Folders.item("Personal Folders")
    Set allPersonalFolders = myPersonalFolder.Folders
    
    T = ""
    For Each Folder In allPersonalFolders
        If Folder.Name = "@ActionTasks" Then
            Set taskf = Folder
            Exit For
        End If
    Next
    
    If Outlook.Application.ActiveExplorer.Selection.Count > 0 Then
        For I = 1 To Outlook.Application.ActiveExplorer.Selection.Count
                Set objMail = Outlook.ActiveExplorer.Selection.item(I)
                Set objMail = objMail.Move(taskf)
                objMail.Save 'Maybe this will update EntryID
                T = T + "** TODO " + objMail.Subject + " :OFFICE:" + vbCrLf
                T = T + "MESSAGE: " + objMail.Subject + " (" + objMail.SenderName + ")"
                T = T + vbCrLf + vbCrLf
                T = T + objMail.Body
                T = T + vbCrLf + vbCrLf
        Next
        ' Now that we have the org-mode tasks, add to org-mode file
        orgfile = GetFile("f:\Documents\org\gtd.org")
        Pos = InStr(1, orgfile, "* Tasks", vbTextCompare)
        orgfile = Mid(orgfile, 1, Pos + Len("* Tasks") + 1) + vbCrLf + T + Mid(orgfile, Pos + Len("* Tasks") + 1, Len(orgfile))
        orgfile = Replace(orgfile, vbCrLf, Chr(10)) ' Change to unix line endings.
!WriteFile "f:\Documents\org\gtd.org", orgfile
Else
!MsgBox "No Message(s) Selected"
End If

End Sub

Functions

Interactive Functions

org-outlook-create-vbs

(org-outlook-create-vbs)

Creates Visual Basic Code for Org-protocol

Internal Functions

org-outlook-open

(org-outlook-open ID)

Open the Outlook item identified by ID. ID should be an Outlook GUID.

org-protocol-do-outlook-capture

(org-protocol-do-outlook-capture INFO CAPTURE-FUNC)

Support org-capture and org-remember alike. CAPTURE-FUNC is either the symbol org-remember or org-capture.

org-protocol-outlook

(org-protocol-outlook INFO)

Process an org-protocol:outlook: style url.

The sub-protocol used to reach this function is set in org-protocol-protocol-alist.

This function detects the Message ID, Subject, Sender and optional text separated by ‘/’. For example either

org-protocol://outlook:/ID/Subject/SenderName/SenderAddress

or

org-protocol://outlook:/o/ID/Subject/SenderName/SenderAddress

works.

By default, it uses the character org-protocol-outlook-default-template-key, which should be associated with a template in org-capture-templates.

To use this plugin:

(“o” “org-outlook” entry (file “~/org/refile.org”) “* TODO Email %c %? %i %U” :clock-in t :clock-resume t)

You may also use the following placeholders

Placeholders Replacement %:link URL of the email %:description The title of the message %:title The title of the message %:initial Selected text. %:sender Sender’s name %:sender-email Sender’s Email

Variables

Customizable Variables

org-outlook-capture

Capturing system for org-protocol outlook: subprotocol. Supports org-capture

org-outlook-location

org-protocol-outlook-default-template-key

Default template for org-capture or remember.

Internal Variables

org-outlook-dir

Org outlook directory

org-stored-links

Contains the links stored with org-store-link.

History

This was generated with OrgReadme. On updating the library, this page is likely to be replaced with updated content.