Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Reference to the Globals.ThisAddIn.Application of project is not Add-In

Tags:

c#

vsto

add-in

In solution has multiple projects. One of them - Word Add-In. From the other (not Add-In) to gain access to Globals.ThisAddIn.Application. How can I do this?

like image 230
Ateist Avatar asked Oct 14 '25 08:10

Ateist


1 Answers

you cant get Globals.ThisAddIn.Application in non Addin project. To get application instance in non addin project you can use

 var wordApplication = (Microsoft.Office.Interop.Word.Application)Marshal.GetActiveObject("Word.Application")
like image 142
Brijesh Mishra Avatar answered Oct 16 '25 23:10

Brijesh Mishra