Microsoft Word Add-in 2013/2016 -- Detect File Tab Visible - ms-word

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?

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.

Related

Built-In Add-Ins tab not displaying on the Ribbon of MS WORD 2010/2013

As the following image from my WORD 2013 shows the Add-Ins tab is missing from the Ribbon of the document even though "File-->Options-->Customize Ribbon Tabs" shows that the tab should display. Same is true for some other tabs shown in the list of Main Tabs on the left side of the image. Question: How can we display these missing tabs?
The Add-ins tab does not have any commands on it. That is why it does not appear in the "Choose commands from" list. Unless you add some commands it will not show in your ribbon even though you have checked the box next to it in the right hand column.
Other tabs in the "Choose commands from" list, such as SmartArt Tools, are context tabs and appear only when in context. So SmartArt Tools only appears if you have a SmartArt object selected, Chart Tools only appears when a Chart is selected, Table Tools appears when a Table is selected, etc.
Context tabs appear in the right column only when you change the drop-down to either All Tabs or Tool Tabs.
Some of the tabs listed under Main Tabs are also context tabs, e.g. Blog Post and Insert (Blog Post) only appear when you create a blog post, Outlining appears only when a document is in Outline view.

Restrict text styling options to custom ribbon tab in word document

I have created custom ribbon tab and added the list of text styling options that I want the users to be using inside my document, however I want to disable all the styling options from the entire document in all the ribbon tabs except the custom tab that I have created.
What I have right now
All the styling options are disabled across all ribbon tabs.
What I want
To disable the styling in all the ribbon tabs except the custom one that I've created.
I think you may be missing the point. One disables not buttons, but commands. This is the basic idea. You can invoke a command (such as "Font color") from many places, using keyboard shortcuts and so on.
So office allows you to disable a command, not a button - and it makes perfect sense.
There is another option - you can remove office ribbon as a whole, using "StartFromScratch" attribute, and provide only the buttons you want instead.

MS Word 2013 Navigation Pane Context Menu

Using MS office 2013:
Does anyone know how I can get the CommandBar item for the Context menu that appears when right clicking an item on the navigation pane?
I want to add some extra options for performing on the range returned by the 'Select heading and content' button.
I can get the navigation pane using Application.CommandBars("Navigation"), but I can't for the life of me seem to be able to find the Context menu associated with this pane. I have even iterated all commandbars and their controls to look at the caption, and I can't even find a commandbar with a control that has the caption SubHeading.
Any ideas are welcome, I don't mind going down the CustomXml route as I am building a VSTO addin, I just want to be able to add buttons to the context menu and get the range for the selected heading and content.
UPDATE 1: Add screenshot of the context menu in question:
UPDATE 2:
Going down the CustomXml route as suggested by Eugene, I am still hitting a wall when I try to customise the menu:
Using the most recent CustomUI documentation from http://www.microsoft.com/en-us/download/details.aspx?id=727 it suggests that the idMso of the context menu for the navigation pane is ContextMenuNavigationPane, but the following xml yields no results (it does work when adding to ContextMenuText).
<?xml version="1.0" encoding="UTF-8"?>
<customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui" onLoad="Ribbon_Load">
<contextMenus>
<contextMenu idMso="ContextMenuNavigationPane">
<button id="SomeNavButtonIAdded" label="Some Button i added" />
</contextMenu>
</contextMenus>
</customUI>
What context menu exactly do you want to customize? Could you take a screenshot?
The fact is that Command bars are not used any longer (were deprecated). The only possible way to customize the context menus in Office 2013 is to use the Fluent UI (aka Ribbon UI). You can read more about that in the following articles in MSDN:
Customizing Context Menus in Office 2010
Customizing the 2007 Office Fluent Ribbon for Developers (Part 1 of 3)
Customizing the 2007 Office Fluent Ribbon for Developers (Part 2 of 3)
Customizing the 2007 Office Fluent Ribbon for Developers (Part 3 of 3)

How can I view Microsoft Office Custom properties via the GUI?

You can programmatically add or delete custom document properties (also called meta data) to a Microsoft Office application like Word. See this link for an example. Now, is there a means to view these added PROGRAMMATICALLY-CREATED custom document properties in Microsoft Office graphical user interface (helps make debugging issues with custom properties easier)?
Yes you can. In office 2010 you can find them under:
File, Info. Then on the right side select the "Properties" dropdown and select "advanced properties" It will give you a popup window where the last tab has the custom properties. It is in the windows on this with header "Properties". If you do not see it there, there "could" be the possibility you are not setting it right.

Change checkbox(Activex control) in word 2007

In word 2007, I'm trying to use the default activex control as check box. I would like the color of text changed after some one check the box it.
I know how to get it done with VBA and checkbox formfield, but how can this be done with checkbox(active control)?
Shortly, is there any way I can retrieve the properties or other object information of ActiveX control check box?
I think this answer is too late for the questioner, how ever i am sending it for those who will face this problem later on.
IF you know how to change check box color in VBA then you can do it in word as well. All you have to do is to insert a check box that you can code your self. to do so.
Generate Developor's Tab in MS Word by clicking word button at the top left of MS WORD 07 Window; Select Advanced; Select Popular; then in the pan opened, check the check box that contains Developor's tab.
Now Click the Developer's Tab, Locate the Control Group and from their, click on legacy tools pull down menu.Click on more controls option at the lowest left of the legacy tools pull down menu. A new Window will open.
Scroll down to find the option Micrsoft Forms 2.0checkbox.
Click to select it, and you are done. You will receive a check box at the place where your cursor was blinking before you startated this process.
This Checkbox is very similar to the Check box from VB. Now if you know the VBA Codes and want to change the properties of check box like color etc. Look at the Control Group in Developer's Tab. Click Design Mode. Now DOUBLE CLICK THE CHECK BOX AND VB CODING FORM OPENS WHERE YOU CAN CODE.
In case you do not know how to code in VB, You can still make some useful changes in check box. Single click on the check box and Then Click Properties Immediately below the Design Mode in the devloper's Tab.
Here you can make changes in properties.