Categories: Blog

ng-conf 2015 – Office Apps Hack-a-thon

The night before ng-conf 2015 started, there were a number of lightning talks and hack-night activities. You might be surprised to see Microsoft as part of the mix. With the lure of several Xbox Ones to give away, there ended up being 11 teams competing for the prizes. Josh Carroll and I represented “Team Wintellect”.

Why was Microsoft here? If you’ve been keeping up, the “new” Microsoft has really done a lot to be more open and work with technology outside of Microsoft. Tonight, they were talking about building AngularJS application as add-ons to Office 365 applications. These are Javascript-based components that can inject new functionality into Excel, Outlook, and others. (There is more detailed information at the Office Dev Center web site).

Our task was to take one of Andrew Connell’s starter projects:

And create our own project that demonstrates some interesting add-on functionality to one of these office apps.

Oh … and there was only two hours to complete it!

Josh and I decided to take a D3.js visualization, specifically this Aster Plot, and have it take the data from an Excel spreadsheet rather than from a CSV file.

This is what we came up with, https://github.com/Wintellect/ng-office-graphs. I apologize up front for the (lack of) quality of this code, but we were successfully able to update data in the spreadsheet and draw the graph based on this data.

(I hope to revisit this code and clean it up. I also forgot to take a screen shot, which I’ll post later.)

The main integration code is below:

Office.initialize = function () {
  console.log(">>> Office.initialize()");

Office.context.document.bindings.addFromPromptAsync('matrix', function (asyncResult) {
      if (asyncResult.status == Office.AsyncResultStatus.Succeeded) {
          console.log(asyncResult);

<pre><code>      asyncResult.value.getDataAsync(function(data) {
          console.log(data.value);

          drawObject.draw(data.value);

      });
  }
</code></pre>

});

After the Office application initializes, we were able to prompt the user for a range of data (addFromPromptAsync) and then pull the data from the spreadsheet (getDataAsync). The rest was just drawing the D3 visualization.

Microsoft has created a nice extensibility interface for office apps and I’m interested to see what new kinds of add-ons will be created.

Also, thanks to Jeremy Thake, Andrew, and Microsoft for the event.

And for the Xbox One, too!

Dave Baskin

Recent Posts

8-Step AWS to Microsoft Azure Migration Strategy

Microsoft Azure and Amazon Web Services (AWS) are two of the most popular cloud platforms.…

21 hours ago

How to Navigate Azure Governance

 Cloud management is difficult to do manually, especially if you work with multiple cloud…

1 week ago

Why Azure’s Scalability is Your Key to Business Growth & Efficiency

Azure’s scalable infrastructure is often cited as one of the primary reasons why it's the…

3 weeks ago

Unlocking the Power of AI in your Software Development Life Cycle (SDLC)

https://www.youtube.com/watch?v=wDzCN0d8SeA Watch our "Unlocking the Power of AI in your Software Development Life Cycle (SDLC)"…

1 month ago

The Role of FinOps in Accelerating Business Innovation

FinOps is a strategic approach to managing cloud costs. It combines financial management best practices…

1 month ago

Azure Kubernetes Security Best Practices

Using Kubernetes with Azure combines the power of Kubernetes container orchestration and the cloud capabilities…

2 months ago