Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Creating a VSTO Add in for multible applications

Tags:

c#

ms-office

vsto

Is it possible to create an VSTO add in for multible office applications?

Can I outsource the functions i want to have for every application and then create an Add-in for every application? If yes, is there a better way to achieve this?

like image 808
municool Avatar asked Nov 25 '25 10:11

municool


2 Answers

I recommend making a solution with an add-in project for each Office application.

Then add a class library project to the solution and reference that from each of the add-on projects.

That way you can centralize code used in all add-ins.

If you need to interact with the active application or document, you can detect the type of the calling object and typecast it to the relevant application/document type.

like image 100
Gertsen Avatar answered Nov 27 '25 22:11

Gertsen


Yes - you can just put your common functions into a shared DLL, just like any other application. Since each VSTO project targets a different application structure and potentially UI paradigm, I'd recommend having different VSTO projects in a single solution, and a shared assembly holding the common code.

like image 24
PhillipH Avatar answered Nov 27 '25 22:11

PhillipH



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!