Cookie CSS

Saturday, April 9, 2016

Dial Number from any Outlook Message Part I

This weekend I set out to write a simple Outlook add-in to allow our employees to quick dial numbers in Outlook message from Skype for Business with a single click.  If you have ever scheduled a meeting using Skype for Business you know the default message formats telephone dial in numbers with a url like tel:5555555555 which makes them clickable and easy to dial.  But what can be done with people that type their contact info into a signature or something that isn't formatted?


My goal was to build something like this.  You can pull it down on any message or appointment, and it will scan the message body, extract the telephone numbers, and present the user with a nice one click dial interface.

Getting Started

To build one of these Outlook add-ins set one is create a new visual studio application and then modify the template files it creates.  There are really 2 pieces. 

1.  The XML manifest.  This is the file that get's installed on Exchange, or published in the Office store.

2.  The web components this xml points to.  This is where the work is actually done.  Microsoft will generate you some boilerplate html and javascript.

Item 1 is where we will focus today, I will assume you can figure out the manifest on your own since it is a pretty easy file to edit by hand or with the gui.

It looks something like this.

<?xml version="1.0" encoding="utf-8"?>
<OfficeApp xmlns="http://schemas.microsoft.com/office/appforoffice/1.1" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xsi:type="MailApp">
  <Id>6880A140-1C4F-11E1-BDDB-0800200C9A68</Id>
  <Version>1.0</Version>
  <ProviderName>Microsoft</ProviderName>
  <DefaultLocale>EN-US</DefaultLocale>
  <DisplayName DefaultValue="Display entities"/>
  <Description DefaultValue=
     "Display known entities on the selected item."/>
  <Hosts>
    <Host Name="Mailbox" />
  </Hosts>
  <Requirements>
    <Sets DefaultMinVersion="1.1">
      <Set Name="Mailbox" />
    </Sets>
  </Requirements>
  <FormSettings>
    <Form xsi:type="ItemRead">
      <DesktopSettings>
        <!-- Change the following line to specify the web -->
        <!-- server where the HTML file is hosted. -->
        <SourceLocation DefaultValue=
          "http://webserver/default_entities/default_entities.html"/>
        <RequestedHeight>350</RequestedHeight>
      </DesktopSettings>
    </Form>
  </FormSettings>
  <Permissions>ReadItem</Permissions>
  <!-- Activate the add-in if the current item in Outlook is -->
  <!-- an email or appointment item. -->
  <Rule xsi:type="RuleCollection" Mode="Or">
    <Rule xsi:type="ItemIs" ItemType="Message"/>
    <Rule xsi:type="ItemIs" ItemType="Appointment"/>
  </Rule>
  <DisableEntityHighlighting>false</DisableEntityHighlighting>
</OfficeApp>

The HTML components are where you can customize the view of the add-in and code the js to pull out the phone numbers.

Next week we'll start coding the HTML/JS files to make our queries.

Doug Routledge, C# Lync, Skype for Business, SQL, Exchange, UC Developer  BridgeOC
Twitter - @droutledge @ndbridge


No comments:

Post a Comment

Any spam comments will be deleted and your user account will be disabled.