Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Creating an addin for Outlook using javascript

I've seen the jello-dashboard for Outlook which adds Getting Things Done (GTD) functionality to Outlook. I'm taken by the fact that it only uses javascript to do this (using extjs). Previously I thought that any add-in dev for MS products were obliged to use VBA on C# or one of the other MS technologies. I've looked through some of the jello-dashboard js files but haven't been able to see (or understand) where it uses what I presume is an API to modify Outlook behaviour.

This is all in the hope of creating an add-in which will add delicious.com like functionality to Outlook, i.e. filtering of e-mails using a tag-cloud approach (based on Outlook categories)

I'd appreciate if anyone has pointers on where I could find the information/examples/tutorials on this javascript => Outlook hookup. I've had no luck on das web but starting from a point of ignorance my searches may be badly formed.

Best regards / Colm

like image 600
carbontracking Avatar asked Feb 21 '12 16:02

carbontracking


1 Answers

Jello isn't really an add-in, per se. What it is doing is basically using a trick. That trick is to create a new folder in Outlook. Then, right click on the new folder and select properties. Then click on the "Home Page" tab. Check the box that says "Show home page by default for this folder". Then in Address type in the address of an html page. E.g., C:\test.html.

Here is some code I whipped up that will show you the subject of the newest message in your inbox that you can paste into C:\test.html

<script>

    var ol = window.external.OutlookApplication;

    function GetCurrentItem(){  
        var ns=ol.GetNameSpace("MAPI");
        var inbox=ns.GetDefaultFolder(6);
        var items = inbox.Items;
        items.Sort("ReceivedTime", true);
        alert(items(1).Subject);    
    }

</script>


<input type=button onclick="GetCurrentItem()" value="GetCurrentItem">
like image 84
aquinas Avatar answered Nov 08 '22 22:11

aquinas