Accessibility support for ribbon controls

Add-in Express™ Support Service
That's what is more important than anything else

Accessibility support for ribbon controls
 
Daniel Lutz


Guest


Hello support,
is there an plan for supporting official accessibility support through the ui-controls of built-in components in add-in express (or a way to use it)?

The windows forms framework use currently the
IAccessible
interface which is buildin as mechanism of an property of each
Control
over
Control.AccessibleObject
which implements the old MSAA legacy variant of microsoft accessibility support. The framework controls contains also some improvements from the better and newer UI Automation infrastructure which is used by screenreader and other ATs.

So currently every "control" (like RibbonButton etc.) is derived from
Component
class so the question is how we can extend this classes to build up support. (I tried some tests with derivative classes but it seems to be that these classes could currently no really handle by the AddinModule instance (there will be not loaded at runtime).

I didn`t find out if ribbons in Microsoft word support Accessibility by default which can mapped by your hook logic but maybe your knows more ;)

Best regards
Daniel
Posted 09 Feb, 2022 08:58:30 Top
Andrei Smolin


Add-in Express team


Posts: 18830
Joined: 2006-05-11
Hello Daniel,

To create the Office Ribbon UI of your COM add-in, you provide Office with an XML describing static parameters and method names defining the dynamic behavior of your Ribbon control.

Note that in this description the term "control" is incorrect. There's no control: what you see is an image controlled by Office who uses that XML to update the image to imitate its dynamicity.

Also, the XML doesn't let you define anything related to accessibility; check https://docs.microsoft.com/en-us/office/vba/library-reference/concepts/overview-of-the-office-fluent-ribbon.

On the other hand I know that the Ribbon controls - those you see in Office - are accessible.

Can it be that you already have what you need? If no, describe your task in more details.

Regards from Poland (CET),

Andrei Smolin
Add-in Express Team Leader
Posted 09 Feb, 2022 09:49:14 Top
Daniel Lutz


Guest


Hello Andrei,

thank you for this information. After some research here are my current state about the topic:

It seems to be that Microsoft Office handles the interpretation of ribbon xml different for builtin controls and VSTO/AddinExpress controls.

Builtin controls set the ScreenTip and SuperTip values as one to the UI Automation helptext property (checked with Accessibility Insights tool). If i set this values in custom xml (VSTO) or as property in addinexpress ribbon designer microsoft office only set the ScreenTip property as helptext. So the ATs (NVDA and Jaws) only read loud this property. In this context the ATs interpret HelpText values different. Jaws read only this value for ribbonmenus instead of ribbonbuttons and NVDA reads both control types.

What i see with the addineexpress variant is the following:


  • supertip support currently not multiline text
  • addinexpress has not support for callbacks mechanism like custom xml in vsto so dynamic string process at start is not possible
  • Quick Info is only showing if:
    [**] screentip and supertip is set
    [**] only screentip is set


Quick info is not showing if only supertip is set (this is different to custom xml in vsto where i can set over the callbacks mechanism screentipp to "" and supertip to multiline text)

Best regards
Daniel
Posted 10 Feb, 2022 05:17:02 Top
Andrei Smolin


Add-in Express team


Posts: 18830
Joined: 2006-05-11
Hello Daniel,

Daniel Lutz writes:
supertip support currently not multiline text


You mean the property editor of the Supertip property; the editor works in the Properties window. This looks like a bug that we will be able to fix. A workaround is: you can set that value in code. This works for me.

Daniel Lutz writes:
addinexpress has not support for callbacks mechanism like custom xml in vsto so dynamic string process at start is not possible


That's not correct. In fact, Add-in Express does support customizing Ribbon properties via callbacks; check section 'Updating custom Ribbon controls at run time'; see the PDF file in the folder {Add-in Express}\Docs on your development PC.

To get the exact XML passed to Office, call Clipboard.SetText(e.XML) in the OnRibbonBeforeLoad event of the add-in module. Note: on rare occasions, this call fails; I ignore this issue and restart the host application.

Studying the XML and related events, you'll find that Add-in Express stores the values supplied at the design time and returns them to Office when callbacks are called. Further below I refer to these callbacks and attributes:
- getScreentip="getScreenTip_Callback"
- getSupertip="getSuperTip_Callback"
- screentip="someValue"
- supertip="someValue"

You can use one of these: getScreentip or screentip; using them simultaneously causes an Office error. The same applies to getSupertip and supertip. BTW, make sure the 'Show add-in user interface errors' checkbox is selected in File | Options | Advanced | General.

Internally, getScreenTip_Callback and getSuperTip_Callback raise the PropertyChanging event. In the event handler, you get e.Type - the type of the property that Office queries - and set e.Value as defined by your logic.

Daniel Lutz writes:
Quick info is not showing if only supertip is set (this is different to custom xml in vsto where i can set over the callbacks mechanism screentipp to "" and supertip to multiline text)


To investigate this issue I've created two add-in projects (VSTO and ADX) and replaced the XML that Add-in Express generates with the XML from my VSTO add-in. I also copied the VSTO callbacks to the add-in module. Ha-ha! This works!

I've asked our guys to look into the test add-ins.

Regards from Poland (CET),

Andrei Smolin
Add-in Express Team Leader
Posted 11 Feb, 2022 04:55:23 Top
Andrei Smolin


Add-in Express team


Posts: 18830
Joined: 2006-05-11
This issue is filed down under #21064 in our issue-tracking DB. When the issue is fixed, you'll find this reference number in whatsnew.txt.

Regards from Poland (CET),

Andrei Smolin
Add-in Express Team Leader
Posted 11 Feb, 2022 05:25:45 Top
Daniel Lutz


Guest


Hello Andrej,

thank you for investigation. So now i found the the section and your mechanism. Thats clarified this topics. This helps enourmes.

Another way for setting multiline text to supertip is the way to use builtin localization. In this way i can handle multiline text for
SuperTip
over the corresponding *.resx

To investigate this issue I've created two add-in projects (VSTO and ADX) and replaced the XML that Add-in Express generates with the XML from my VSTO add-in. I also copied the VSTO callbacks to the add-in module. Ha-ha! This works!


That sound great. But if the PropertyChange event maps to original callbacks then i will use the to use the "official" way.

Thank you for fixing the issues and help.

Best regards

Daniel
Posted 11 Feb, 2022 08:00:26 Top
Andrei Smolin


Add-in Express team


Posts: 18830
Joined: 2006-05-11
Hello Daniel,

The mapping occurs due to the way Add-in Express creates the Ribbon XML. Find the XML as e.XML in the OnRibbonBeforeLoad event of the add-in module.

That is, if I supply a Ribbon XML of my own, it becomes an original XML and it uses callbacks that I specify.

Regards from Poland (CET),

Andrei Smolin
Add-in Express Team Leader
Posted 16 Feb, 2022 05:26:55 Top