How to use javascript in a custom Outlook 2010 view? RRS feed

  • Question

  • Hi

    I see some Outlook addIns have views where its seems like they use a mini html-js UI. If I were to create a custom view in an Outlook Add-in (be it a folder, email compose, or calendar item), how can use html + javascript to create the custom UI in Outlook 2010?

    Will I be able to access Outlook items or data on Exchange server using the javascript?



    Tuesday, December 10, 2013 8:40 PM


All replies

  • Hello Hiren,

    Could you please take a screenshot of the custom UI in which you are interested in?

    The Outlook Object Model (nor Office extensibility model) doesn't provide any way for customizing the Outlook UI with HTML and JavaScript. In case of .Net (and VBA macros) add-ins you can customize the Fluent UI with pre-defined set of ribbon controls. You can read more about this in the Customizing the 2007 Office Fluent Ribbon for Developers article in MSDN. Also you can use Outlook Form Regions , publish your own Custom Outlook Forms, customize an Outlook home folder page (see How to programmatically create an Outlook home folder page in the Outlook Today style ).

    Wednesday, December 11, 2013 8:31 AM
  • Hi Eugene,

    The best example I have in mind is like what xobni created. They had this side bar which looks likes its being rendered by html+javascript and can talk with web services and Outlook.

    How would I create a section in say an email compose view or the inbox view or the folder and use html+javascript to interface with outlook and a web service to provide some rich information?


    Wednesday, December 11, 2013 9:36 AM
  • Hiren,

    Why did you decide that HTML & JavaScript is used for this? :)

    At first sight, I think they use custom WPF or Silverlight controls.

    Anyway, it looks like they subclass an Outlook window and inject their own window into the UI. This is not a trivial way for implementing and requires some knowledge of Windows API. For example, take a look at the Adjacent Windows In Outlook page. It also contains a reference to the sample project. Finally, you may consider using the Outlook Form Regions instead.    

    Wednesday, December 11, 2013 9:49 AM
  • Eugene,

    That's a good question. I was told that's how xobni and some others were implementing access to external services in Outlook, but that could be incorrect.

    Here is another example I just found: http://stackoverflow.com/questions/9381564/creating-an-addin-for-outlook-using-javascript

    Can this method be used together with the Outlook Form Regions?


    Thursday, December 12, 2013 5:25 AM
  • Hello Hiren,

    There are two possible ways for running JavaScript with HTML in Outlook. The first is to use a folder home page. But that way is obsolete and can be removed in subsequent Outlook versions. The second is to embed a WebBrowser control into a form region (or any form in Outlook) and display the required web page.

    Thursday, December 12, 2013 8:52 AM
  • Eugene,

    Thanks for your answers. Its been insightful.


    Thursday, December 19, 2013 9:05 PM