Cookie CSS

Saturday, April 23, 2016

Dial Number from any Outlook Message Part III

Now that we know how to retrieve the phone numbers from the message using the entities methods of the Office API we need to turn that information into dialable hyperlinks.  In the default application settings on your pc, there is a protocols section.  If you scroll through it you may find your tel protocol is configured for an application on your machine, like Skype for Business.  What this means is a link like tel:17012124797 will send that data to your default application, and in the case of Skype for Business it will pop up a new window with a prompt to click here to call + 1 (701) 212-4797.  It's as simple as that you click it and it calls the number.

Making the hyperlink

In ASP.net it's pretty a pretty simple process.  We create a webform and add a panel to it.

I have a simple text array with 2 entries per line, description (0) and the telephone number (1)

It would look something like this.

Work, 7012124797
Mobile, 7012121015

For each row I do something like this.

 string[] i = p.Split(',');

HyperLink h = new HyperLink();
                            h.Text = i[0] + ":+" + i[1];
                            h.NavigateUrl = "tel:" + i[1];
                            //Response.Write(i[1]);

                            Panel g = new Panel();
                            g.Controls.Add(h);

                            Panel1.Controls.Add(g);

The result of this would be a list of  hyperlinks in the panel.  When a user clicks on them the default application will receive the data.


This will wrap up this blog series.  Don't worry, you don't have to write this app in order to use it.  It is now live for FREE in the Office Store.


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