Posts Tagged “Web Add-ins”

A few days ago I encountered a question on Stack Overflow about using tabs to align content in a Word document. The required result was something like this:

I started looking at the Word JS API documentation and realized there is nothing in that object model for inserting tabs or defining tab stops. Read the rest of this entry »

Comments No Comments »

One of the most useful methods for debugging VBA is Debug.Print, to see what variables contain or what a statement returns. JavaScript has a similar capability: console.log();. Read the rest of this entry »

Comments No Comments »

The most recent post in this series introduced the concept of loading properties from the Word object before being able to work with them. The line of code in question is range.load("text"); from the Basic API snippet for Script Lab. This article goes into that concept in more depth. Read the rest of this entry »

Comments No Comments »

If you’re curious about the Office JS API application object models and want to get acquainted you can do so without any investment other than time. All you need is a Microsoft account and Office 365 / Office 2016 installed on your machine (Windows or Mac) or access to Office Online. Then you can install Script Lab. Read the rest of this entry »

Comments No Comments »

Since last I wrote about “Web Add-ins” and the Office JavaScript API a lot has happened. Office 2016 with the updated APIs has been released and the APIs are constantly being up-dated. Those with a subscription will receive the updates more regularly than anyone who has installed Office from an msi. Web add-ins for Office 2016 (and later) run not only on the Windows desktop, like VBA, VSTO and other solutions, they also run on Mac, iPad, mobile devices and the on-line versions of the Office applications. Read the rest of this entry »

Comments No Comments »

The previous post discussed how to find out what Word Open XML is required in order to insert a particular type of content. This article will consider a practical example and demonstrate how the Word Open XML can be stored in a resource file, then loaded and modified by JavaScript code before being inserted into the Word document. Read the rest of this entry »

Comments No Comments »

In both the posts about Coercion types in Word Web Add-ins and reading built-in document properties a key point is using the Word Open XML file format in order to achieve something not available in the APIs. This approach works only in Word and it can be used for almost anything. Even the newer, extended APIs that will be released for Office 2016 won’t (initially) provide functionality for everything that can be contained in a Word document. So working with the Word Open XML file format is a useful tool for the JavaScript as well as the VBA and .NET developer. Read the rest of this entry »

Comments No Comments »

I hope you’ve had a chance to think about the code in the previous post for reading the value of a document property. This post will consider the problem of looping when async calls are involved, using that as the basis for the discussion. Read the rest of this entry »

Comments No Comments »

Besides writing to a specified place in a document, the other major thing an “App for Word” can do is communicate with Custom XML Parts. Mainly, I suppose the reason this was included in the original APIs is because Word can link a content control to a node in a Custom XML Part. Changing the content of either the content control or the node will mirror that change at the other end of the link. This capability is of interest for “data-mining” documents since it’s a fairly simple task to read a Custom XML Part from a closed Word document by leveraging the Office Open XML. Read the rest of this entry »

Comments No Comments »

Here’s another tool where you can try out JavaScript, on-line: JS Fiddle. The link is to the tutorial page, in the documentation. The actual editor is here.

Microsoft provides a number of resources, besides the documentation on MSDN, for learning about the Office (2013) APIs. Read the rest of this entry »

Comments 2 Comments »

Here are a some tips for improving your “experience” in the Visual Studio IDE when testing the Office APIs. Read the rest of this entry »

Comments No Comments »

In the last four installments, the basics of creating a Web Add-in and reading/inserting information was introduced, using two different data formats: matrix and plain text. When working with Word, especially, formatting can be just as important as text content. For this reason, Word supports more and complexer content types than the other Office applications. This post focuses on using these coercion types in a Web Add-in. Read the rest of this entry »

Comments No Comments »

As you’ve seen from the discussions about JavaScript and creating the “Hello World” Web Add-in sample, working with non-proprietary programming languages, such as JavaScript, does have at least one advantage: You’re not locked into any particular software to write your code. In order to create VBA code you need the VBA editor, running in an Office application. JavaScript, HTML and CSS can be typed anywhere.

On the other hand, an editor with Intellisense and automatic formatting can save wear-and-tear on your fingers and your nerves! So this post will show you how to write Web Add-ins in a free version of Visual Studio. Read the rest of this entry »

Comments No Comments »

I hope you’re not feeling too intimidated and have been able to create and load the “Hello World” sample

This post takes a closer look at the JavaScript part of the sample. The discussion is in two parts: First, how JavaScript is linked into the HTML page; then, the JavaScript code with the main focus on the Office JS API. Read the rest of this entry »

Comments 3 Comments »

As became apparent in the previous post introducing Web Add-ins, a Web Add-in consists of more than a single file containing the code. Distributing and installing a Web Add-in is more complex than handing someone an Office document containing the code and explaining how to change the settings in the Trust Center so that it can run. Why is this? Read the rest of this entry »

Comments No Comments »

My discussion of Web Add-ins will center on Word, since that’s “where I live”. The information on the basics is certainly relevant to other Office applications (Excel and PowerPoint) if the Web Add-in is hosted in a Task Pane – the only kind of Web Add-in Word supports.

So, what all is involved in creating a Web Add-in? Unfortunately, it’s not only JavaScript and the Office JavaScript APIs – that’s just the programming language and object model. At least some knowledge of HTML is required and familiarity with CSS is an advantage. Read the rest of this entry »

Comments 2 Comments »