diff --git a/source/NVDAObjects/window/excel.py b/source/NVDAObjects/window/excel.py index b8d239a8c80..dbc75e938f7 100755 --- a/source/NVDAObjects/window/excel.py +++ b/source/NVDAObjects/window/excel.py @@ -15,6 +15,7 @@ from comtypes import COMError, BSTR import comtypes.automation +import inputCore import wx import time import winsound @@ -1844,17 +1845,27 @@ def _get_positionInfo(self): # In Office 2016, 365 and newer, comments are now called notes. # Thus, messages dialog title and so on should refer to notes. @script( - # Translators: the description for a script for Excel - description=_("Reports the note on the current cell"), + description=_( + # Translators: the description for a script for Excel + "Reports the note on the current cell. If pressed twice, presents the information in browse mode" + ), gesture="kb:NVDA+alt+c", category=SCRCAT_SYSTEMCARET, speakOnDemand=True, ) - def script_reportComment(self, gesture): + def script_reportComment(self, gesture: "inputCore.InputGesture") -> None: commentObj = self.excelCellObject.comment text = commentObj.text() if commentObj else None if text: - ui.message(text) + repeats = scriptHandler.getLastScriptRepeatCount() + if repeats == 0: + ui.message(text) + elif repeats == 1: + ui.browseableMessage( + text, + # Translators: title for note on the current Excel cell dialog. + _("Note"), + ) else: # Translators: A message in Excel when there is no note ui.message(_("Not on a note")) diff --git a/user_docs/en/changes.md b/user_docs/en/changes.md index 81d10656ff9..6d668a1ea61 100644 --- a/user_docs/en/changes.md +++ b/user_docs/en/changes.md @@ -7,6 +7,7 @@ ### New Features * Enhanced Microsoft Word comment command: press twice to present comment content in browsable message. (#16800, @Cary-Rowen) +* Enhanced Microsoft Excel notes command: press twice to present notes content in browsable message. (#16878, @Cary-Rowen) * NVDA can now be configured to report font attributes in speech and braille separately. (#16755) diff --git a/user_docs/en/userGuide.md b/user_docs/en/userGuide.md index bf40eb19ce7..107a5c53b97 100644 --- a/user_docs/en/userGuide.md +++ b/user_docs/en/userGuide.md @@ -1536,7 +1536,8 @@ Selecting a form field and pressing enter or the Move to button moves to that fi #### Reporting Notes {#ExcelReportingComments} -To report any notes for the currently focused cell, press NVDA+alt+c. +To report any notes for the currently focused cell, press `NVDA+alt+c`. +Pressing twice shows the information in a browsable message. In Microsoft 2016, 365 and newer, the classic comments in Microsoft Excel have been renamed to "notes". All notes for the worksheet can also be listed in the NVDA Elements List after pressing NVDA+f7.