Collectives™ on Stack Overflow
Find centralized, trusted content and collaborate around the technologies you use most.
Learn more about Collectives
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Learn more about Teams
I have a VSTO addin which I want to invoke from a C# EXE. thisaddin.designer.cs file has a constructor as below.
Collapse | Copy Code
public ThisAddIn(global::Microsoft.Office.Tools.Word.ApplicationFactory factory, global::System.IServiceProvider serviceProvider) :
base(factory, serviceProvider, "AddIn", "ThisAddIn") {
Globals.Factory = factory;
I have added the reference of Addin to my C# project and tried the below. But, not sure what arguments to pass.
Collapse | Copy Code
MTMWordAddIn.ThisAddIn addin = new MTMWordAddIn.ThisAddIn(null, null);
Kindly suggest.
Thanks.
–
I am not sure if the approach above would work.
I would rather make the exe to check for Word version and just change the vsto name in the registry entry.
When you install VSTO the registry will be added here
HKEY_CURRENT_USER\Software\Microsoft\Office\Word\Addins
These registry key should have Manifest String Key and Value should be the path of the VSTO file.
Your exe can look for the Word version and change the path in the registry entries.(This might need permission if the key is in HKEY_LOCAL_MACHINE).
Or rather use NetOffice which is compatible from Word 2000 to 2013
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.