Exportieren (0) Drucken
Alle erweitern
EN
Dieser Inhalt ist in Ihrer Sprache leider nicht verfügbar. Im Folgenden finden Sie die englische Version.

Working with Active Accessibility in the 2007 Office Fluent User Interface

Office 2007

Summary:   This document describes the accessibility options available to 2007 Microsoft Office system developers to help in developing assistive technology applications. (24 pages)

A variety of assistive technology applications are available to help people with disabilities use Microsoft Office applications. Examples of assistive technologies include magnifiers, screen readers, speech synthesizers, and speech recognition applications.

If you develop assistive technologies, you need to be aware of a number of changes in the 2007 Microsoft Office release that impact those technologies. The most significant change in the 2007 Office system is the Microsoft Office Fluent user interface (UI).

The Office Fluent UI replaces UI elements in previous versions of Microsoft Office, elements such as layered menus, toolbars, and dialog boxes, with new UI elements like the Ribbon, Galleries, and the Quick Access Toolbar (among others). The goal of the Fluent UI is ease of use: software applications that use the Office Fluent UI are easier to learn, easier to use, and deliver a better experience than applications which do not.

However, many underlying changes to accommodate the new UI paradigm require assistive technologies to be updated so that they can continue to help users with disabilities effectively and easily use Microsoft Office applications. This article discusses the underlying changes and how assistive technology applications can work with the new Office Fluent user interface.

If your assistive technology application needs to navigate the Ribbon, you need to know how UI elements on the Ribbon are laid out. User interface elements on the Ribbon are exposed to Microsoft Active Accessibility (MSAA) clients as COM objects. In the MSAA hierarchy, the Ribbon is presented through MSAA as a tabbed dialog box. Each tab in the Ribbon is presented as a role value of ROLE_SYSTEM_PAGETAB, the same type of element for a tab in a tabbed dialog box.

When focus is on a Ribbon tab, pressing the TAB key navigates to the first control on that tab. Continuing to press the TAB key navigates through the rest of the controls on the tab. When the last control on the tab is reached, pressing the TAB key navigates out of the Ribbon tab first to the Help button, then to the Office button, then through the QAT controls, and finally back to the Ribbon tabs. Tabbed dialog boxes also work this way. For example, in a typical tabbed dialog box pressing the TAB key moves from the active tab through each of the controls on the tab and then off the tab, typically to an OK or a Cancel button.

On each tab, controls with similar functions are organized into group components; you can navigate from group to group by pressing SHIFT+LEFT ARROW or SHIFT+RIGHT ARROW. However, unlike a tabbed dialog box, you cannot use CTRL+TAB to move between tabs.

The MSAA tree for the Ribbon in Microsoft Office Word 2007 is structured as follows:

Ribbon (root element, ROLE_SYSTEM_PROPERTYPAGE)

  • Quick Access Toolbar (ROLE_SYSTEM_TOOLBAR element)

    • Elements that represent individual controls on the QAT

  • Customize Toolbar (ROLE_SYSTEM_PUSHBUTTON element)

  • Ribbon Tabs (ROLE_SYSTEM_PAGETABLIST element)

    • Nameless ROLE_SYSTEM_CLIENT element

    • ROLE_SYSTEM_PAGETAB elements that represent standard tabs

    • ROLE_SYSTEM_GROUPING element for contextual tab headers

    • ROLE_SYSTEM_PAGETAB elements that represent contextual tabs

  • Microsoft Office Word Help (ROLE_SYSTEM_PUSHBUTTON element)

  • Office Button (ROLE_SYSTEM_BUTTONDROPDOWNGRID element)

  • Lower Ribbon (ROLE_SYSTEM_PANE element)

    • Nameless ROLE_SYSTEM_CLIENT element

    • ROLE_SYSTEM_PROPERTYPAGE element that represents the active tab in the Ribbon

    • ROLE_SYSTEM_TOOLBAR elements that represent individual groups in the Ribbon

    • Elements that represent individual controls in a group

NoteNote

This description is not the complete tree; it only displays the portions of the tree that are of interest for the Ribbon.

Similar to the structure of a tabbed dialog box, the ROLE_SYSTEM_PAGETAB elements for the tabs in the Ribbon are not direct ancestors of the elements on the active Ribbon tab. As a result, the ROLE_SYSTEM_PAGETABLIST sub-tree is a sibling of the Lower Ribbon.

Figure 1. The MSAA tree for the Ribbon as seen in the Accessible Explorer

The MSAA tree for the Ribbon

To determine the UI context for a control, a common approach is to get a focus event, then get the IAccessible for the element that has focus, and then keep navigating to the parent element, looking for an element with a predefined accName (for example, "Quick Access Toolbar" or "Ribbon Tabs"). However, because the accName for each element in the MSAA tree is localized, this approach would fail for languages other than English.

To allow the MSAA tree to be navigated regardless of the locale, the key elements in the MSAA tree have an accValue that is not localized (these element types do not normally have an accValue property). The values are shown in Table 1.

Table 1. Key elements of the MSAA tree

accRole

accValue (Not Localized)

U.S. accName (Localized)

ROLE_SYSTEM_PROPERTYPAGE

Ribbon

Ribbon

ROLE_SYSTEM_TOOLBAR

Quick Access Toolbar

Quick Access Toolbar

ROLE_SYSTEM_PAGETABLIST

Ribbon Tabs List

Ribbon Tabs

ROLE_SYSTEM_PANE

Lower Ribbon

Lower Ribbon

ROLE_SYSTEM_PROPERTYPAGE

Ribbon Tab

Varies; each tab has its own name

ROLE_SYSTEM_TOOLBAR

Group

Varies; each group has its own name

ROLE_SYSTEM_PROPERTYPAGE

Status Bar

Status Bar

If your assistive technology application needs to process the KBShortcut property for a Ribbon control in the Ribbon, you need to know the format of the property. The KBShortcut property for Ribbon controls contains:

  • The CTRL key sequence for the control (if one exists)

  • A semicolon as a delimiter (if both other portions appear)

  • The ALT key sequence for the control (if one exists)

For example, the KBShortcut property to bold text in Word is CTRL+B; ALT, H, 1. The ALT key sequence contains a comma between each KeyTip to indicate that the user can press ESC to cancel it. Conveniently, the comma also causes most screen readers to pause when reading back the key sequence (that is, a screen reader says: A [pause] H [pause] 1).

If a key sequence contains multi-letter KeyTips, they are separated by a space in the KBShortcut property. For instance, the KBShortcut property for the Font Type combo box is ALT, H, F F. The space ensures that screen readers say each character separately instead of trying to pronounce both characters as a single word.

Much of the functionality in the 2007 Office system is only available in certain situations. For instance, you can only format a table in Word when the current selection contains part of (or all of) a table. Determining when a user wants certain functionality, and when that functionality should be hidden, has posed a challenge to user interface designers for a long time.

The Ribbon solves this problem with contextual tabs: tabs that appear when their functionality can be used and that disappear when their functionality is not available. To see a contextual tab in action, insert a table in Word. When the table is selected, a contextual tab appears in the Ribbon; when the current selection no longer includes the table, the tab disappears.

If two contextual tabs on the screen have the same name, your assistive technology application may need to differentiate them. To see two contextual tabs that have the same name, insert a table into a Word 2007 document. Then, insert a SmartArt graphic into the table. The Ribbon now has four contextual tabs, two of which are named "Design." Notice that the tabs are grouped together: there is a "Design" tab and a "Format" tab grouped under a heading named "SmartArt Tools" and a "Design" tab and a "Layout" tab grouped under a heading named "Table Tools."

In the MSAA tree hierarchy, the Ribbon tabs are represented as ROLE_SYSTEM_PAGETAB elements that are descendents of a ROLE_SYSTEM_PAGETABLIST element whose accValue is "Ribbon Tab List." A normal Ribbon tab is a direct child of the ROLE_SYSTEM_PAGETABLIST element. A contextual tab is a child of a ROLE_SYSTEM_GROUPING element, which in turn is a direct child of the ROLE_SYSTEM_PAGETABLIST element (making the ROLE_SYSTEM_PAGETAB element for the contextual tab a grandchild of the ROLE_SYSTEM_PAGETABLIST element).

That ROLE_SYSTEM_GROUPING element represents the header for the contextual tab, and its accName is the text displayed on the screen for the contextual tab. In this example, the MSAA tree looks like:

Ribbon Tabs (ROLE_SYSTEM_PAGETABLIST, accValue is "Ribbon Tabs List")

  • SmartArt Tools (ROLE_SYSTEM_GROUPING, contextual tab header)

    • Design (ROLE_SYSTEM_PAGETAB, a contextual tab)

    • Format (ROLE_SYSTEM_PAGETAB, a contextual tab)

  • Table Tools (ROLE_SYSTEM_GROUPING, contextual tab header)

    • Design (ROLE_SYSTEM_PAGETAB, a contextual tab)

  • Format (ROLE_SYSTEM_PAGETAB, a contextual tab)

To determine when a contextual tab appears or disappears, an assistive technology application can listen to MSAA events that are thrown by the contextual tab. Two such events that are thrown are the EVENT_OBJECT_STATECHANGE event and the EVENT_OBJECT_SELECTION event.

When a contextual tab appears, whether or not the contextual tab is selected, an EVENT_OBJECT_STATECHANGE event is thrown. When this happens, the following are true:

  • An EVENT_OBJECT_STATECHANGE event is thrown for a ROLE_SYSTEM_PAGETAB.

  • The parent of the ROLE_SYSTEM_PAGETAB is a ROLE_SYSTEM_GROUPING element with an accName matching the category label for the contextual tab that appears on the screen.

  • The parent of that ROLE_SYSTEM_GROUPING element is a ROLE_SYSTEM_CLIENT element whose parent is the ROLE_SYSTEM_PAGETABLIST element with an unlocalized accValue of "Ribbon Tabs List."

  • The ROLE_SYSTEM_PAGETAB may or may not be STATE_SYSTEM_SELECTED, depending on whether that particular contextual tab is selected.

When a contextual tab becomes selected (including when it appears and is automatically selected), the EVENT_OBJECT_SELECTION event is thrown. When this happens, the following are true:

  • The EVENT_OBJECT_SELECTION event is for a ROLE_SYSTEM_PAGETAB.

  • The ROLE_SYSTEM_PAGETAB can acquire focus but is not focused (the document usually has focus).

  • The parent of the ROLE_SYSTEM_PAGETAB is a ROLE_SYSTEM_GROUPING element with an accName matching the category label for the contextual tab that appears on the screen.

  • The parent of that ROLE_SYSTEM_GROUPING element is a ROLE_SYSTEM_PAGETABLIST with an unlocalized accValue of "Ribbon Tabs List."

The File menu is now the Microsoft Office Button. The accName property is "Office Button" and the accRole property is ROLE_SYSTEM_BUTTONDROPDOWNGRID.

An assistive technology application might need to change its behavior when the Ribbon changes its size. When an Office application window with a Ribbon is reduced in size, the Ribbon rescales itself to keep all functionality available. If necessary, the Ribbon collapses a group of controls down to a single control whose accName property is the name of the group and whose role is ROLE_SYSTEM_BUTTONDROPDOWNGRID. The control is keyboard accessible and displays the controls in the group when activated.

When a group is collapsed to a control, the control has an ALT key sequence that can be used to access the collapsed group. However, the extra letters in the ALT key sequence are optional for accessing controls within the collapsed group. As a result, users who have a visual impairment do not know that a group is collapsed, because the original ALT key sequences for a control works, regardless.

For example, in Word, the ALT key sequence to activate the Font Type combo box is ALT, H, F F. If you significantly reduce the size of the Office application window, the Font group that contains the Font Type combo box eventually collapses to a single control, which has an ALT key sequence of ALT, H, Z F. If you then want to activate the Font Type combo box, you can either use an ALT key sequence that includes the control for the collapsed group, which would be ALT, H, Z F, F F; or you can use the original ALT key sequence ALT, H, F F.

To prevent the Ribbon from scaling, some assistive technology applications might want to automatically maximize the Office application window. The Office application window can be maximized using the following Microsoft Visual Basic for Applications code:

Application.WindowState = xlMaximized (Excel)
Application.WindowState = wdWindowStateMaximize (Word)
Application.WindowState = ppWindowMaximized (Powerpoint)

The Ribbon does not scale when it is collapsed (see the "Collapsed Ribbon" section under Keyboarding later in this article for more details on collapsing the Ribbon). In this case, when a user reduces the size of the Office application window, the Ribbon is displayed in its normal size when it is accessed.

In the 2007 release of Microsoft Office, some controls are updated and some are new. These controls are used in several places including the Ribbon, the Status Bar, some task panes, and in the Options dialog box for applications.

The Combo Box

The following information is from the MSAA documentation for combo boxes. It is included here because combo boxes historically have not conformed to the MSAA specification and many screen readers have trouble correctly reading a compliant combo box.

NoteNote

When the combo box list is not visible, it is not part of the MSAA tree for the combo box. Only when the combo box list is visible does it become part of the MSAA tree. This is not addressed by the MSAA specification. This condition is true for both combo boxes and drop-down controls.

Table 2. Name property

Combo Box Part

Name

Combo box window

Static text control used as a label

Edit control

Static text control used as a label

Drop-down arrow

"Open" or "Close" depending on the state of the drop-down list

List box

Associated label

List item

Text of the list item

Table 3. Value property

Combo Box Part

Value

Combo box window

Text of currently selected list item

Edit control

Text of currently selected list item

Drop-down arrow

None

List box

None

List item

None

Table 4. Role property

Combo Box Part

Role

Combo box window

ROLE_SYSTEM_COMBOBOX

Edit control (or static text control)

ROLE_SYSTEM_TEXT or ROLE_SYSTEM_STATICTEXT

Drop-down arrow

ROLE_SYSTEM_PUSHBUTTON

List box

ROLE_SYSTEM_LIST

List item

ROLE_SYSTEM_LISTITEM

Table 5. State property

Combo Box Part

Possible States

Combo box window

STATE_SYSTEM_INVISIBLE | STATE_SYSTEM_UNAVAILABLE | STATE_SYSTEM_FOCUSED | STATE_SYSTEM_FOCUSABLE | STATE_SYSTEM_NORMAL

Edit control

STATE_SYSTEM_INVISIBLE | STATE_SYSTEM_UNAVAILABLE | STATE_SYSTEM_FOCUSED | STATE_SYSTEM_FOCUSABLE | STATE_SYSTEM_NORMAL

Drop-down arrow

0, which means the button is visible and not pressed; or STATE_SYSTEM_PRESSED |

STATE_SYSTEM_INVISIBLE | STATE_SYSTEM_NORMAL

List box

STATE_SYSTEM_INVISIBLE | STATE_SYSTEM_UNAVAILABLE | STATE_SYSTEM_FOCUSED | STATE_SYSTEM_FOCUSABLE | STATE_SYSTEM_FLOATING | STATE_SYSTEM_NORMAL

List item

STATE_SYSTEM_INVISIBLE | STATE_SYSTEM_FOCUSABLE | STATE_SYSTEM_FOCUSED | STATE_SYSTEM_SELECTABLE | STATE_SYSTEM_SELECTED | STATE_SYSTEM_NORMAL

Table 6. KBShortcut property

Combo Box Part

KeyboardShortcut

Combo box window

Access key of associated label

Edit control

None

Drop-down arrow

ALT+DOWN ARROW

List box

None

List item

None

Table 7. DefAction property

Combo Box Part

DefaultAction

Combo box window

None

Edit control

None

Drop-down arrow

Open or Close depending on the state of the drop-down list

List box

None

List item

Double Click

The 2007 Office system uses SplitButton controls more often than in previous versions of Microsoft Office. In the 2007 release, SplitButton controls can appear on menus and on the Ribbon.

A SplitButton control is a compound control that is capable of two actions. The split-button control contains a button element, which can receive focus, and a drop-down button element, which cannot. The button element, when activated, performs a direct action, whereas the drop-down button, when activated, displays a list with more options.

When activated, the button element either performs a default action which is always the same, or it performs the most recent action that was chosen from the drop-down list. In the latter case, the action it performs changes depending on the most recent action chosen. When the button element can perform different actions, the icon on the button can be updated to indicate what action it performs. In Word 2007, the Font Color and Text Highlight Color SplitButton controls are examples of SplitButtons whose icons update; the Bullets and Numbering SplitButton controls are examples of SplitButtons whose icons do not update.

When activated, the drop-down button element displays a list containing more options. The list may include list items, menu items, flyout menus, or any combination of the three. In the case of SplitButton controls on a menu, the drop-down button element visually appears to be a button with a horizontal arrow, which displays a flyout menu.

The keyboard behavior for SplitButton controls on the Ribbon differs from the keyboard behavior of SplitButton controls on a menu. The keyboard behavior of the SplitButton control is detailed in Table 8.

Table 8. SplitButton control keyboard behavior

Behavior

Ribbon SplitButton Controls

Menu SplitButton Controls

Only the button element gets keyboard focus

True

True

SPACEBAR

Drops list

Displays the list

ENTER

Drops list

Presses button

F4

Drops list

Displays the list

ALT+DOWN ARROW

Drops list

Displays the list for SplitButton controls on Office button menu / Dismisses contextual menu

RIGHT ARROW (LEFT ARROW for right-to-left languages)

2-D focus navigation

Displays the list (displays flyout menu)

The MSAA architecture for SplitButton controls resembles the MSAA architecture for combo boxes.

A SplitButton control has three elements: a ROLE_SYSTEM_SPLITBUTTON element for the button, a ROLE_SYSTEM_BUTTONDROPDOWN element for the drop-down button, and a ROLE_SYSTEM_GROUPING element that parents the other two.

The Ribbon contains controls—such as the Header control on the Insert tab of Microsoft Word—that drop a list. Controls that drop a list have ROLE_SYSTEM_BUTTONDROPDOWN roles, just like the drop-down button element of a SplitButton control.

An assistive technology application can distinguish between controls like the Header control (which are simple controls) and SplitButton controls (which are compound controls) by viewing the parent of the drop-down element.

If the parent is a group name (with a role of ROLE_SYSTEM_TOOLBAR and a non-localized accValue of "Group") then the drop-down element is a simple control, otherwise the parent is the container element for the compound control.

Some examples of SplitButton controls in Word include:

  • As controls in the Ribbon. For instance, on the Home tab, the Font Color, Text Highlight Color, Bullets, and Numbering controls are SplitButtons.

  • As flyout menu items on the Microsoft Office Button. The Save As and Print menu options are SplitButton controls.

  • As flyout menu items on a context menu (right-click in the surface area in a Word document). The Bullets and Numbering options on the context menu are SplitButton controls.

See Table 9 for the MSAA design of SplitButton controls.

Table 9. MSAA design of SplitButton controls

Name

Properties

accName

Container: control name

SplitButton: control name

DropButton:

  • Open (if the popup is not displayed)

  • Close (if the popup is displayed)

NoteNote
For SplitButton controls in the Office menu and context menus, the accName is always set to Open because clicking the DropButton does not close the flyout menu.

accValue

Container: none

SplitButton: value that would be applied when clicked. For example, the default color for a color picker.

DropButton: none

NoteNote
The accValue is not propagated to the container. A SplitButton control only has an accValue if the icon updates to represent what the button portion of the SplitButton control does when clicked.

accRole

Container: ROLE_SYSTEM_GROUPING

SplitButton: ROLE_SYSTEM_SPLITBUTTON

DropButton: ROLE_SYSTEM_BUTTONDROPDOWN or ROLE_SYSTEM_BUTTONDROPDOWNGRID

NoteNote
The convention used is that if a control displays a two-dimensional list then the control has a role equal to ROLE_SYSTEM_BUTTONDROPDOWNGRID. If a control has a role equal to ROLE_SYSTEM_BUTTONDROPDOWN then the control displays a one-dimensional list.
NoteNote
Because the list dropped from a ROLE_SYSTEM_BUTTONDROPDOWNGRID DropButton is two-dimensional, visually impaired users will want to use the TAB key to navigate the list if they want focus to pass through each item (these lists are architected so that TAB moves though all the items on the list). Using the up and down arrow keys to navigate such a list moves focus two-dimensionally and therefore does not move though all of the elements in the list. Because the list dropped from a ROLE_SYSTEM_BUTTONDROPDOWN DropButton is one-dimensional, using the arrow keys to navigate the list moves focus through each item.

accState

Container: normal

SplitButton:

  • pressed (if switched on in Ribbon controls)

  • checked (if switched on in menu controls)

  • focusable

  • focused (if it already has the focus)

DropButton: STATE_SYSTEM_HASPOPUP

accDescription

Container: contains the string for the Super ToolTip for the dropdown button, if one exists

SplitButton: contains the string for the Super ToolTip for the SplitButton element, if one exists

DropButton: none

accKBShortcut

Container:

  • ALT accelerator key sequence for Ribbon SplitButton controls

  • None for Office menu SplitButton controls

  • None for context menu SplitButton controls

SplitButton:

  • None for Ribbon SplitButton controls

  • ALT accelerator key sequence for Office menu SplitButton controls

  • Enter for context menu SplitButton controls

DropButton:

  • ALT accelerator key sequence for Ribbon SplitButton controls

  • ALT accelerator key sequence for Office menu SplitButton controls

  • Letter accelerator key sequence for context menu SplitButton controls

accDefaultAction

Container: none

SplitButton:

  • Press for Ribbon controls

  • Execute for menu controls

DropButton:

  • Open (if the popup is not displayed)

  • Close (if the popup is displayed)

NoteNote
For SplitButton controls in the Office menu and context menus, the accDefaultAction is always set to Open because clicking the DropButton does not close the flyout menu.

The ListView control reports information in multiple columns. For an example of a multiple column ListView control, go to the Word Options dialog and choose the Add-Ins option. This option contains a ListView control with three columns.

The MSAA tree for new ListView controls works as follows:

  • Each list item in the ListView control is represented by a ROLE_SYSTEM_LISTITEM whose accName represents the entire item. A screen reader that only reads back the ROLE_SYSTEM_LISTITEM works for single column ListView controls, which are the most common type of ListView control.

  • The list item has a child for each column of the list view. Each child is either a ROLE_SYSTEM_STATICTEXT object representing the content for that column of that row; or a ROLE_SYSTEM_GROUPING element whose children together represent the contents for that column of that row.

The 2007 Office system introduces a new type of control called a gallery. Gallery controls are used extensively throughout the Ribbon and are represented as a button that displays a list, a Split Button control that displays a list, or a container that exposes some choices and displays a list to reveal all possible choices (also called an In-Ribbon gallery). What makes gallery controls unique are the contents of the displayed list; the list of a gallery can contain any subset of the following:

  • List items

  • Menu items

  • Category headers

  • Flyout submenus

Gallery menu items and flyout menus work like standard menu items and flyout menus. Gallery list items, however, are different from standard list items in one respect; they are not direct children of the list control. Instead, they are grouped together into categories. The categories are represented as ROLE_SYSTEM_GROUPING elements which are direct children of the list control; the list items are children of the ROLE_SYSTEM_GROUPING elements. The accName of the ROLE_SYSTEM_GROUPING element is the text that appears for the category header.

List items in a gallery control work much like other controls in the Ribbon; if you view the accName of their parent element, you can read their category header. As the user navigates through the gallery control, if the accName of the parent element changes then the user has navigated into a new category.

NoteNote

Sometimes a gallery control does not contain a category header for list items in the control because all of the list items are considered to be in the same category. The Text Highlight Color Split Button control on the Write tab in Word is an example of this. In cases like this, the list items in the gallery control has a ROLE_SYSTEM_GROUPING element as a parent; however, the accName for that ROLE_SYSTEM_GROUPING element might be empty.

NoteNote

Gallery controls can also display two different types of lists: a one-dimensional list and a two-dimensional list. This is an important distinction, particularly for users who have visual impairments, because it dictates which keys can be used to move through all of the items in the list. In particular, if a list is one-dimensional, the TAB key, the UP ARROW key, and the DOWN ARROW key move through all the items in the list; if a list is two-dimensional, only the TAB key moves through all of the items in the list. You can use arrow keys to navigate a two-dimensional list, but in some places, the LEFT ARROW and RIGHT ARROW keys are necessary to move through certain items. If you cannot see the screen, it might be difficult to navigate in this manner.

NoteNote

The type of list the gallery drops is communicated by the accRole of the drop button. If the role is ROLE_SYSTEM_BUTTONDROPDOWN, then the gallery control displays a one-dimensional list. If the role is ROLE_SYSTEM_BUTTONDROPDOWNGRID then the gallery control displays a two-dimensional list.

Another type of control is the In-Ribbon gallery. Examples of In-Ribbon gallery controls are the Quick Styles gallery in Word; the Chart Quick Layout gallery and the Chart Styles gallery in Excel; and the Shapes gallery, the Themes gallery, and the Transition Scheme gallery in Microsoft Office PowerPoint 2007.

Figure 2 shows a screen shot of the Quick Styles gallery in Word.

Figure 2. The Quick Styles gallery control in Word 2007

The Quick Styles gallery control in Word 2007

An In-Ribbon gallery is a container that exposes some, but not all, of the choices available from the gallery. These exposed choices can be clicked with the mouse but are not directly accessible from the keyboard. The gallery can also display a list that reveals all possible choices that are accessible from the keyboard. Because keyboard focus goes directly to the drop-down button for an In-Ribbon gallery, to a user who has a visual impairment an In-Ribbon gallery appears identical to other galleries that display a dropdown list.

An In-Ribbon gallery has the following MSAA structure:

  • A ROLE_SYSTEM_GROUPING element which contains the following:

    • A ROLE_SYSTEM_LIST object that contains all the available Gallery options

    • A Row up ROLE_SYSTEM_PUSHBUTTON for scrolling items in the visible window

    • A Row down ROLE_SYSTEM_PUSHBUTTON for scrolling items in the visible window

    • A ROLE_SYSTEM_BUTTONDROPDOWNGRID that drops the list with all available options

Figure 3 shows a screen shot of the MSAA tree.

Figure 3. MSAA tree for Quick Styles gallery in Word

MSAA tree for Quick Styles gallery in Word

Dialog launcher controls in the Ribbon have an accRole equal to ROLE_SYSTEM_PUSHBUTTON. Based on just the role, a screen reader cannot tell that the control actually launches a dialog box. However, it is a Microsoft Windows convention that UI elements that have an ellipsis (...) at the end of the accName launch a dialog box (more specifically, elements that have an ellipsis at the end of the accName are considered incomplete actions and the action is usually completed in a dialog box). In addition to Dialog Launchers, this convention also applies to menu items, list items, and other elements.

As part of the accName property, an ellipsis can be represented as either three separate periods (three characters) or as a single Unicode character (\u2026).

A Spinner control is a compound control made up of several elements:

  • An edit box (ROLE_SYSTEM_TEXT) which stores the value

  • An up button and a down button (ROLE_SYSTEM_PUSHBUTTON) to increment and decrement the values of the spinner

  • An up down control (ROLE_SYSTEM_SPINBUTTON), sometimes called a spin box, which is a container element for the up button and the down button

  • For spinner controls in the Ribbon, a ROLE_SYSTEM_GROUPING element contains the ROLE_SYSTEM_TEXT and ROLE_SYSTEM_SPINBUTTON objects

Group boxes in the Ribbon, in the status bar, and in some task panes were changed so that the ROLE_SYSTEM_GROUPING element that represents the group box is always an ancestor of the controls in the group box. Previously, that ROLE_SYSTEM_GROUPING element was not directly in the ancestor chain (which is also valid MSAA, but not easy to work with).

Note that the ROLE_SYSTEM_GROUPING object may not be the direct parent of its contained controls; a ROLE_SYSTEM_CLIENT container element often appears between the ROLE_SYSTEM_GROUPING element and the controls in the group box (though most assistive technology applications ignore ROLE_SYSTEM_CLIENT objects when navigating an MSAA tree). An example MSAA tree for a group box looks like:

ROLE_SYSTEM_GROUPING element for the group box (accName equal to the label of group box)

  • ROLE_SYSTEM_OUTLINEBUTTON or ROLE_SYSTEM_STATICTEXT element, depending on whether the group is collapsible, with its accName being set to the group box’s Header text

  • ROLE_SYSTEM_CLIENT element, with its accName being the Header text of the group box

    • First control in group box

    • Second control in group box, and so on

As a result, an assistive technology application can easily detect when the focus has moved to a control within such a group box by navigating up the MSAA tree looking for a ROLE_SYSTEM_GROUPING element with an accName.

Closing a Task Pane

In Microsoft Office 2003 there was no control that could receive focus from the keyboard to close a task pane. Instead, task panes were closed by pressing CTRL+F1. In the 2007 Office system, CTRL+F1 collapses and expands the Ribbon, so a person who has low vision may inadvertently close and open the Ribbon when trying to close task panes.

In the 2007 Office system, the user can move focus to the task pane (by using F6, for example) and then press CTRL+SPACEBAR to display a workpane options window that contains commands for moving, resizing, and closing a task pane.

Skipping Groups in the Ribbon

Most Ribbon tabs contain a large number of controls; the Home tab in Word contains more than 40. Because Ribbon tabs are two dimensional, the simplest way for a user who has low vision to consistently navigate through all of the tabs is to press the TAB key.

To allow users to rapidly navigate between groups in the Ribbon, users can move from one group to another by pressing either SHIFT+RIGHT ARROW or SHIFT+LEFT ARROW. Doing this causes the focus to move to the first control of the next group in the direction of the arrow.

NoteNote

If focus is currently in control that can be edited (such as a combo box, a textbox, or a spinner), SHIFT+RIGHT ARROW or SHIFT+LEFT ARROW does not navigate out of the control.

This action, when used in conjunction with a screen reader that reads back the group names, enables users who have visual impairments to easily navigate the Ribbon.

Legacy Keyboard Mode

The 2007 system supports ALT key sequences from Office 2003. For example if you press ALT, O, F in Word, the Font dialog box appears. Because of this backward compatibility, some of the tabs in the Ribbon have less intuitive ALT key sequences. As a result, the Insert tab in the Ribbon uses ALT, N because ALT, I is reserved for the Insert menu in Office 2003.

After you press ALT with a legacy key, you are in legacy keyboard mode until you either complete the ALT key sequence or press ESC. When in legacy keyboard mode, all keystrokes are ignored, except valid legacy shortcuts and ESC.

Only the exact ALT key sequence is supported. If you press ALT, I and then press the DOWN ARROW, the down arrow is ignored.

If the user activates the legacy keyboard mode, an EVENT_OBJECT_FOCUS event is triggered for the message box mentioned previously. The text in the message box is localized for each language. Furthermore, an assistive technology application that receives an EVENT_OBJECT_FOCUS event for a ROLE_SYSTEM_DIALOG element with an accValue equal to LEGACYKBDIALOG (which is not localized, to enable this scenario) can detect when legacy keyboard mode is activated and can provide additional information or assistance, if necessary. The user remains in legacy keyboard mode until a new EVENT_OBJECT_FOCUS event is triggered.

The only visual indication that legacy keyboard mode is active is a message box in the middle of the Ribbon that says Office 2003 access key: <access key>. Continue typing the Office 2003 menu key sequence, or press Escape to cancel. The legacy keyboarding mode is only for users who have memorized these key sequences from Office 2003.

Collapsing the Ribbon

In Office 2003, pressing CTRL+F1 closes a task pane. In the 2007 Office system, pressing CTRL+F1 collapses or expands the Ribbon (for information on closing a task pane in the 2007 Office system, see Closing a Task Pane).

During usability testing, some users with visual impairments accidentally collapsed the Ribbon when they tried to close a task pane. When the Ribbon is collapsed, ALT key sequences are still available and function normally. In fact, if you cannot see the screen, you do not know that the Ribbon is collapsed. The big difference is that if you press ALT to put focus on the Ribbon, you cannot press the DOWN ARROW key or the TAB key to navigate into the Ribbon to explore it—you need to first press the SPACEBAR to display the lower Ribbon and then you can navigate it. So, a user with low vision who has memorized all the ALT key sequences does not know that the Ribbon is collapsed because everything works as expected. However, users with low vision who want to search the Ribbon for a specific feature need to know that the Ribbon is collapsed and that they have to press the SPACEBAR to display a tab so they can navigate it.

There are various things that an assistive technology application can do to detect that the Ribbon is collapsed:

  • When the Ribbon is collapsed, the accState of the Lower Ribbon object in the MSAA tree tree includes STATE_SYSTEM_INVISIBLE and is thus unavailable.

  • Pressing CTRL+F1 triggers an EVENT_OBJECT_STATECHANGE event for the Lower Ribbon object. This object has an accName equal to Lower Ribbon (localized), accValue equal to Lower Ribbon (not localized), and accRole equal to ROLE_SYSTEM_PANE. The application just needs to check the accState for a setting of invisible, meaning that it is unavailable.

  • When the Ribbon is collapsed, the tabs include the state value of STATE_SYSTEM_HASPOPUP. This is not true for tabs when the Ribbon is expanded.

Getting Super ToolTip Content Using MSAA

An assistive technology application should not need to trap Super ToolTips because this information is available in the accDescription property of the element with which they are associated. This is the intended purpose of the accDescription property; the accName property stores a brief description of the control and the accDescription property stores a more extended, detailed description of the control.

Note that for compound controls, the accDescription property of the container element stores the Super ToolTip description. This includes Ribbon combo boxes and drop-down controls, split buttons, galleries, and spinners.

Changes to EVENT_OBJECT_FOCUS Event in PowerPoint 2007

For many of the presentation design surfaces, Microsoft Office PowerPoint 2003 triggers an EVENT_OBJECT_FOCUS event for an object without an accName property value. As a result, although a screen reader could tell that focus had changed, it couldn’t tell where focus was by using the MSAA tree.

These objects were updated so that they now contain a meaningful localized accName value. They can be identified by the following attributes:

  • Role = ROLE_SYSTEM_CLIENT

  • Window class = paneClassDC

The following table shows the PowerPoint windows trigger an EVENT_OBJECT_FOCUS event on such an object.

Table 10. PowerPoint elements

Slide

Slide Sorter

Master Thumbnails

Slide Master

Title Master

Presenter View Slide

Notes

Slide Show

Presenter View Notes

Handout Master

Slide Notes

Presenter View Thumbnails

Notes Master

Print Preview

   

Outline

Thumbnails

   

The 2007 Office system makes SmartArt graphics accessible to users with visual impairments. Users can insert SmartArt graphics from the Insert tab of the Ribbon in Microsoft Office Word 2007, Microsoft Office Excel 2007, Microsoft Office PowerPoint 2007, and Microsoft Office Outlook 2007.

The Choose a SmartArt Graphic Dialog Box

The Choose a SmartArt Graphic dialog box is where users choose the type of SmartArt graphics to insert. In this dialog box:

  • When the All category is selected (the default setting), the layouts that can be chosen are grouped into categories. In the screenshot in Figure 4, the category header List is visible. These category headers cannot receive the focus, but are represented in the MSAA tree as ROLE_SYSTEM_GROUPING elements (specifically, the parent of the element that has focus is a ROLE_SYSTEM_GROUPING element, and if that ROLE_SYSTEM_GROUPING element has an accName, that accName is the category header). This is identical to the way that category headers are represented in other galleries.

  • The TAB key is used to navigate from the category list to the list of the individual layouts to the OK and Cancel buttons. As a result, unlike other galleries, the TAB key does not navigate through the individual layouts in the list. Instead, when the end of the current row is reached, the right and left arrow keys wrap to the next row. Thus, the right and left arrow keys can be used to move to all the individual layouts in the list.

  • Each layout has a paragraph that describes the graphic in detail. Visually, the paragraph is displayed on the right side of the dialog box and cannot receive key focus. However, that description is also available as the accDescription property for the individual layout item so it can be read back by a screen reader.

Figure 4. Choose a SmartArt Graphic dialog box

Choose a SmartArt Graphic dialog box

SmartArt Authoring Environment

After a user selects a SmartArt graphic, the graphic is inserted and selected (this is similar to the way that charts function in Excel). This authoring environment is composed of a Text pane on the left and the actual graphic on the right (this is reversed in a Right-to-Left language such as Arabic). The Text pane is a tree view that enables users to navigate, promote or demote, and add items in the graphic (by using arrow keys, the ENTER key, or the TAB key). As nodes are added or deleted from the tree view, the corresponding shapes or bullets are added or deleted from the graphic.

Nodes can also have special attributes. For example, a node can be hidden, can function as an assistant node, or both. To see an example of a hidden node, create a Venn diagram and create more than seven nodes; all nodes after the seventh node are hidden nodes and have a red X next to them. To see an example of an assistant node, create an organization chart; the second node is an assistant node and has a unique icon. The accName property for a hidden node contains the text the user typed and has –hidden appended to it; the accName property for an assistant node contains the text the user typed and has –assistant appended to it; and a node that is both hidden and functioning an assistant node contains the text the user typed and has –assistant, hidden appended to it.

A user can move the focus from the Text pane to the corresponding shape in the SmartArt graphic by pressing CTRL+SHIFT+F2. Text can be typed into a shape or node by pressing CTRL+SHIFT+F2 to put focus in the corresponding location and then typing. When you finish typing, pressing CTRL+SHIFT+F2 again puts the focus back in the Text pane. Text for shapes can also be typed into the Text pane; however, the Text pane does not expose the contents of the nodes as editable text. The shapes that make up the SmartArt graphic are Office Art shapes so they should be accessed through their object model. After focus has been moved to a shape, all the attributes of the shape can be manipulated.

In addition, when focus is in the Text pane, pressing CTRL+SHIFT+F1 displays help that describes in detail how to use SmartArt graphics.

Figure 5. SmartArt authoring environment

SmartArt authoring environment
Figure 6. SmartArt layout with hidden nodes

SmartArt layout with hidden nodes
Figure 7. SmartArt layout with an assistant node

SmartArt layout with an assistant node

In Word 2007, users insert equations by pressing ALT+=. Because equations are no longer OLE objects, assistive technology vendors might need to update their applications.

In Word 2007, inserting or editing equations is a mode, similar to turning bold on or off Bold in a document. The following Visual Basic statement checks if an equation has been entered while navigating with the keyboard.

Selection.OMaths.Count

This returns a value of 0 if the current selection does not contain an equation and returns a positive integer if the current selection does contain an equation.

The Word 2003 object model has an issue where, if a selection is collapsed to a cursor and a call is made to the object model, the character properties applied to the cursor selection are not properly saved and restored as the object model call is made. As a result, Word 2003 can potentially get into a state where the object model incorrectly reports the character properties for the cursor; for instance, the object model can potentially report the bold property as being enabled when in fact it is not.

Two solutions to this problem were enabled. They are:

  • Set the registry key: HKEY_CURRENT_USER\Software\Microsoft\Office\12.0\Word\Options\DontResetInsertionPointProperties:DWORD = 1. This enables a solution for the duration of the application session. Of the two approaches, this one is not recommended.

  • Using the Word 2007 object model, set Application.DontResetInsertionPointProperties to True to temporarily enable the fix. Set it back to False when the request for information is done. Make this change only in places where it is absolutely necessary. Please note that this setting is not saved when Word is closed. This should not be an issue if the property is disabled correctly. The following code demonstrates a macro using this approach.

    Sub Macro1()
        ' This sample demonstrates how to toggle the bold/italic/underline
        ' buttons by an irrelevant operation. Move the cursor to some 
        ' white space,click the bold, italic or underline button and execute 
        ' this macro. The buttons revert to the style of the preceding 
        ' character.
        Dim aRange As Range
        Dim aPageSetup As PageSetup
        Dim aUnderline As WdUnderline
        
        ' Set the solution.
        Application.DontResetInsertionPointProperties = True
        
        Set aRange = Selection.Range
        aRange.Collapse (wdCollapseStart)
        Bold = aRange.Bold
        Italic = aRange.Italic
        aUnderline = aRange.Underline
        MsgBox "Bold = " & Bold & " Italic = " & Italic & _
                " Underline = " & aUnderline
        Set aPageSetup = aRange.PageSetup
        
        aRange.Bold = Bold
        aRange.Italic = Italic
        aRange.Underline = aUnderline
        
        ' Reset the solution.
        Application.DontResetInsertionPointProperties = False
    End Sub
    
    

Registry Keys for Assistive Technology Applications

The 2007 Office system contains two registry keys that enable existing versions of assistive technology applications to work within the document body of Word 2007 and Outlook 2007. Because of changes in the way that Word writes to the screen, some assistive technology applications do not work with Word 2007 or Outlook 2007 (for instance, when Word 2007 is used as the e-mail editor). The following registry keys might fix problems with such applications.

Cursor in E-Mail Registry Key

This registry key changes Outlook so that when an e-mail message is opened, the message body receives the focus and a cursor appears. The e-mail message is still set as read-only. However, the insert point can be moved within the body of the e-mail and selections can be created. All of the standard keyboard navigation keys continue to work and the e-mail message is accessible through the object model. This allows a visually impaired user to navigate an Outlook e-mail message as if the message were a Word document.

In addition, this registry key also reverts the selection highlight color in both Word 2007 and Outlook 2007 to the selection highlight color used in Office 2003 and also unselects ClearType.The registry key setting is:

[HKEY_CURRENT_USER\Software\Microsoft\Office\12.0\Common]

"ScreenReaderPresent"=DWORD:00000001

Disabling Off-Screen Buffering in Word

Word 2007 renders the screen differently than it did in Office 2003; Word 2007 uses an off-screen buffer and does not render directly to the screen. As a result, assistive technology applications that use certain methods of scraping the screen to determine the selection may not work correctly. The following registry key allows an application to disable off-screen buffering and revert Word 2007 to its previous behavior:

[HKEY_CURRENT_USER\Software\Microsoft\Office\12.0\Word\Options]

"WordAlternateDisplayMethodForScreenReaders" = DWORD:00000001

One side effect of setting this registry key is that it causes Word to flicker frequently, which might be distracting for some visually impaired users. Changing this registry key is not recommended.

Q: My application has intercepted an EVENT_OBJECT_FOCUS event for a list item or menu item and I think focus is in a gallery. How do I tell the name of the category for the list item that has focus?

A: Many times, list items in a gallery are grouped into categories. Visually, the category header appears to be a label with a bluish-grey shaded background that cannot take focus. When you handle an EVENT_OBJECT_FOCUS event for a list item, access the parent of the list item. If the parent is a ROLE_SYSTEM_GROUPING element that has an accName that is not empty, the accName is the name of the category. If there is a ROLE_SYSTEM_GROUPING element but the accName of the ROLE_SYSTEM_GROUPING element is empty, then no category label is displayed.

Be aware that list items in a list might be grouped into multiple categories, yet the parent ROLE_SYSTEM_GROUPING elements for the list items do not have accNames. In this case, no category labels are visible; however, the unnamed categories show visual separation, so assistive technology tools might still want to notify their users that they have entered a new category when focus crosses from one category to another.

Q: How do I change the Office 2007 color theme?

A: Open the Control Panel. Click Accessibility Options, click Display, and then select the option Use High Contrast. The 2007 Office system now uses the Windows theme colors.

Q: How do I programmatically unselect ClearType?

A: Office 2007 supports ClearType. In the Windows Vista operating system where ClearType is enabled by default, Office 2007 uses the operating system setting. In the Windows XP operating system where ClearType is disabled by default, Microsoft Office overrides the operating system setting for ClearType and always enables it.

You can change the ClearType setting in the 2007 Office system that is running on Windows XP either manually or programmatically. To disable the setting manually, use the Popular tab of the Options dialog. To disable the setting programmatically, set Application.Options.AlwaysUseClearType to False in Word 2007 or set Application.AlwaysUseClearType to False in Excel 2007. Be aware that this setting affects all Microsoft Office applications; changing it in one application affects all of them.

Q: What is Live Preview and how do I programmatically disable it?

A: Live Preview is a new feature that shows you what the selection in the document area looks like if you apply the formatting change that currently has focus. For example, in Word, type The quick brown fox and select the word quick. If you click through the options in the Font Size dialog box, the selected word update to show you what it would look like if you were to apply the currently selected font size. Some things to consider when developing your own applications include:

  • When text is being previewed, the text is shown without the selection highlight color.

  • If your application displays an object in the document area, the position of the object being displayed may be wrong when text is previewed. This can occur if your object does not dynamically update its position as the previewed text changes.

  • For PowerPoint 2007 and Word 2007, the object model is not updated when a selection is previewed. For Excel 2007, the object model is updated when a selection is previewed.

  • Live Preview can be manually disabled in the Options dialog of the application.

When an Office application starts, it checks the Windows SPI_GETUIEFFECTS system setting; if this setting is disabled then Live Preview (and animations) is also disabled. This setting can affect many aspects across the entire operating system. A more precise method of programmatically disabling Live Preview is to set Application.Options.EnableLivePreview to False in Word 2007; or to set Application.EnableLivePreview to False in Excel 2007.

You can find more information about the topics discussed in this article at the following locations:

Microsoft führt eine Onlineumfrage durch, um Ihre Meinung zur MSDN-Website zu erfahren. Wenn Sie sich zur Teilnahme entscheiden, wird Ihnen die Onlineumfrage angezeigt, sobald Sie die MSDN-Website verlassen.

Möchten Sie an der Umfrage teilnehmen?
Anzeigen:
© 2015 Microsoft