Is there a standard way to access a C# (or VB.NET) library from an Office 365 Web Add-In? I have a very large VSTO Word Add-In with a substantial amount of code written in C#, so I need to know if I can re-use this functionality without having to rewrite it all.
Yes -- see this Microsoft tutorial on this:
Tutorial: Share code between both a VSTO Add-in and an Office Add-in with a shared code library
In a nutshell, you use REST APIs to call your libraries written in C# from your new Web add-in written in JavaScript or TypeScript. This allows you to use those libraries for both your VSTO and Web add-in, or while transitioning from one to the other, etc.
I'm afraid that it's not possible for an Office Web Add-in to talk to a VSTO add-in and call the code of the VSTO add-in. Among other reasons, Office Web Add-ins are intended to work cross-platform. They should run in Office for Mac, for example. That would not be possible if they have a dependency on a VSTO add-in. (See this SO question for more about that: Does VSTO Add-In support to Mac(iOS) Operating system?.)
Yes -- see this Microsoft tutorial on this:
Tutorial: Share code between both a VSTO Add-in and an Office Add-in with a shared code library
In a nutshell, you use REST APIs to call your libraries written in C# from your new Web add-in written in JavaScript or TypeScript. This allows you to use those libraries for both your VSTO and Web add-in, or while transitioning from one to the other, etc.
© 2022 - 2024 — McMap. All rights reserved.