I am developing my first Word 2007 addin, and I added OfficeRibbon to my project. In the mouse click handler, I need a link to either the current Word.Documentone or Word.Application.
I am trying to get a link through a property OfficeRibbon.Contextthat, according to the documentation, should reference the current object Application. However, he is always null.
Does anyone know or
a) if there is something that I need to do to make the OfficeRibbon.Contextdisplayed correctly populated?
b) if there is any other way, can I get a link to a Word Application or an active Word document?
Notes:
I am using VS2008 SP1
The ribbon looks as if it was initialized perfectly: the ribbon displays correctly in Word; I can configure the debugger using both the constructor and the OnLoad elements; Mouse button handlers execute correctly.
Here is online help for this property ;
OfficeRibbon.Context Property
C#
public Object Context { get; internal set; }
An object that represents the inspector window or application instance associated with this OfficeRibbon object.
Notes
In Outlook, this property refers to the Inspector window in which this OfficeRibbon is displayed.
In Excel, Word, and PowerPoint, this property returns the application instance in which this OfficeRibbon is displayed.
source
share