This project has moved and is read-only. For the latest updates, please go here.

VSTO to NetOffice

Mar 18, 2012 at 2:53 AM
Edited Mar 18, 2012 at 8:03 AM

Is there an equivalent of Globals.ThisAddIn.Application in NetOffice

Mar 18, 2012 at 12:17 PM


NetOffice is designed as substitute for the interop assemblies. These Globals are VSTO specific. VSTO is an own concept/framework top of the interop assemblies. thats the reason for, its easy to convert a interop assembly project to NetOffice but more difficult to convert a VSTO project.
anway, the autor from the Excel-DNA project suggest me to create a globals module 3 weeks ago. this module is not excactly the same as VSTO.
its the <Global> module with all the nice helpermethods und properties(also application object) what you know from VBA maybe, this module comes with NetOffice 1.4.1 next week. for the future i want more VSTO features in NetOffice of course, its still a young project :-) 


Aug 26, 2013 at 9:11 PM
Similar to the question above I used to use the line below in a static function to return a reference to the com addin:

return Globals.ThisAddin;

Can you please tell me how I can get a reference to the current addin object.

PS only been using this one day and it looks like a great project, thanks.

Aug 26, 2013 at 10:07 PM
NO spend a static helper module for the office application but not for the adinn instance currently (except for the NO tools namespace with more options)
but its easy to implement i find:
// example
class MyAddin
   _singleton = this;
internal static Addin Singleton { get{ return _singleton;} } 
private static Addin _singleton;

// usage
return MyAddin.Singleton;

Aug 26, 2013 at 10:27 PM
Edited Aug 26, 2013 at 10:50 PM
Sorry I didn't read you code properly, you are answering my question I will give it a go now


Aug 26, 2013 at 10:57 PM
Yep that works thank you so much :)