2

I am developing a word add-in in C#. In word 2013/2016, the file tab takes up the whole document window and covers the editable text area. I need to know when the editable text region becomes no longer visible because the file menu is selected/visible. Some form of callback would be ideal, but a property would suffice.

I looked in the Application, Window, and Document objects for callbacks that indicate a file menu selection -- no success.

I looked for properties that indicate that the file menu is visible -- no success.

I looked for a callback or property that indicates that the editable area of the document is no longer visible -- no success.

Any ideas?

Cindy Meister
  • 25,071
  • 21
  • 34
  • 43
  • I also would not be opposed to some sort of Win32 solution. I tried monitoring a word document using SetWinEventHook(), but I was not able to find any way of detecting when the file menu was pressed. – Andrew Umlauf Mar 26 '18 at 16:36

1 Answers1

0

The Backstage UI provides the onShow and onHide callbacks that allow to detect when the File tab is shown and hidden.

   <backstage onShow="OnShow">

Read more about that in the Customizing the Office 2010 Backstage View for Developers article.

Also you may find the Introduction to the Office 2010 Backstage View for Developers article helpful.

Eugene Astafiev
  • 47,483
  • 3
  • 24
  • 45
  • This project is a visual studio 2013-2016 VSTO project. Is there a way to configure the onShow and onHide callbacks for this type of project? – Andrew Umlauf May 30 '18 at 03:53