Coffee'd Up Hacker
Coffee'd Up Hacker

Reputation: 1446

How to create an Office VSTO Add-in that replicates the behavior of Office Add-ins?

The title probably doesn't reflect what I'm trying to do well.

I am working on a Task Pane Office Add-in, mainly for Word, that is currently the new type of Add-in using Office.js, however, we need to support Word 2010, so to my understanding we need a VSTO version of the Add-in that does the same things.

We don't need to interact with the document, we don't read or write to the document, so we don't need any code to run outside of the web app, the whole Add-in is written in HTML and JavaScript. So my thinking is we could create a very simple VSTO Add-in that just contains a WebView that loads our web app without Office.js.

Is that a reasonable way of achieving backward compatibility to Word 2010?

My problem is finding a starting place to do this. Word 2010 is very old, and it seems using a WebView has all sorts of compatibility issues and other bugs. I'm having trouble finding reliable information/tutorials.

Is it possible to bundle WebView2 with the Add-in to eliminate the backward compatibility issues?

Or maybe my thinking here is all wrong, and there is better way of achieving backward compatibility?

I'm open to anything, just seeking information.

Upvotes: 1

Views: 376

Answers (2)

abestrad
abestrad

Reputation: 906

One option is share code/ libs. If you need the same functionality. This will enable you to continue servicing your users that use the VSTO Add-in on Office on Windows and the ones using Office addins.

  1. Create a shared class library by refactoring code into a .NET class library.
  2. Create a REST API wrapper using ASP.NET Core for the shared class library.
  3. Call the REST API from the Office Add-in to access shared code.

Microsoft Share code docs

Upvotes: 1

Eugene Astafiev
Eugene Astafiev

Reputation: 49395

It doesn't work that way. The WebView is not enough for running web add-ins on older Office applications like Word 2010. The support for add-ins should be implemented in the host application itself.

The best what you could do is to develop a VSTO based add-in without relying on the existing web add-in. Or just create a web app (without officejs involved) which can be run in a browser hosted on the task pane in Word.

Upvotes: 0

Related Questions