Search code examples
vstooffice-interopoffice-addins

Is there any way to embed a VSTO add-in into a document?


At this moment, I have a VSTO add-in fulfilling my requirement. But it needs to run with Visual Studio or installed. Ideally, I want to have a Word file containing this VSTO add-in and put this file on my server so that user can use my add-in just by downloading this file, no need to any extra work. Is it possible?

Any help would be appreciated.


Solution

  • A VSTO project must be installed, whether it's an add-in or a document-level customization. Installation ensures that the correct version of the .NET Framework and other pre-requisites are installed. It also includes the user explicitly trusting the solution.

    If you want something that distributes with a document then you need VBA, embedded in the document and saved as a *.docm file. Note that this file type will trigger macro security - some people will have settings that won't allow VBA to run. Some will have settings that can allow "trusted" and/or signed projects to run (you can research that).