Description
Background
In build 13901, MS Word introduced "Modern comments" which allows comment threads (I.e. an initial comment plus replies) and the ability to resolve or reopen threads. The new UI to do this is exposed as a new comments side pane which shows the comments and replies in a treeview. This UI is only exposed via UI Automation.
This UI is supposed to completely replace the older Comments story in a document.
As this new UI is imbedded within the document, it shares the same window handle. If NvDA is using the object model to access the document (I.e. the UIA provider of the document's window is ignored) then NVDA never sees the modern comments UI at all. It seems that MS Word does not ever proxy this to MSAA either.
Also, if MS Word detects that something is trying to access the comments via the object model in the old way (E.g. calls comment.range) then the Modern comments UI is disabled (hidden) and MS Word ends up in a state where querying the range at the selection of the object model is no longer in the comments story, yet the UI is not shown either. This MS Word bug is known to Microsoft however they have no plans or willingness to fix it. Their only recommended solution is to stop using the object model and just use UIA.
Steps to reproduce:
Using NVDA 2021.2 with the Use UIA in MS Word documents NVDA setting disabled,
Open MS Word build 13901 or above.
Create a new blank document.
Type some text.
Select 1 or more characters, and choose New Comment from the context menu.
Actual behavior:
After the context menu closes, NVDA reports the focus is back in the document at the position of the selected text.
Pressing alt+f12 to get to the Comments side pane does not work.
There is no way to get into the Comments story of the document either.
Expected behavior:
After leaving the context menu, one of the following is expected:
- Focus should be in the comments side pane, allowing the user to type the comment and post or cancel it, or
- Focus should be on the document but the selection should be in the older Comments story, allowing you to type the comment.
ideas for a fix
If MS Word build 13901 or higher:
NVDAObjects.window.winword.WordDocumentTextInfo
(I.e. text info for MS Word object model): Don't fetch text or manipulate the selection in any way if selection.storyType is wdCommentsStory.- in UIAHandler.handler.isUIAElement: return true if the element's windowHandle is _WwG but an ancestor of the element has a UIA className of NetUIHWNDElement.
If we were able to successfully fix this issue for NVDA 2021.3, then we could push back UIA by default, and also the new support for math in UIA to 2022.1, ensuring that they get more testing time.
Note also that we can only support math from build 14326 onwards, yet modern comments were introduced in build 13901. Thus builds within this period still require this fix.
System configuration
NVDA installed/portable/running from source:
Installed
NVDA version:
2021.2
Windows version:
Windows 11 build 22483.
Name and version of other software in use when reproducing the issue:
Microsoft® Word for Microsoft 365 MSO (Version 2111 Build 16.0.14613.20000) 64-bit
Other information about your system:
Other questions
Does the issue still occur after restarting your computer?
yes.
Have you tried any other versions of NVDA? If so, please report their behaviors.
Recent builds of NVDA alpha (approaching 2021.3) use UIA by defauitl in MS Word from build 13901 upwards to avoid this issue. However, there are still some other issues relating to UIA support which may block UIA by default in NVDA 2021.3.
If add-ons are disabled, is your problem still occurring?
Yes.
Does the issue still occur after you run the COM Registration Fixing Tool in NVDA's tools menu?
Yes.