1111import ctypes
1212from hwPortUtils import SYSTEMTIME
1313import scriptHandler
14+ from scriptHandler import script
1415import winKernel
1516import comHelper
1617import NVDAHelper
2930import ui
3031from NVDAObjects .IAccessible import IAccessible
3132from NVDAObjects .window import Window
33+ from NVDAObjects .window .winword import WordDocument as BaseWordDocument
3234from NVDAObjects .IAccessible .winword import WordDocument , WordDocumentTreeInterceptor , BrowseModeWordDocumentTextInfo , WordDocumentTextInfo
3335from NVDAObjects .IAccessible .MSHTML import MSHTML
3436from NVDAObjects .behaviors import RowWithFakeNavigation , Dialog
@@ -552,7 +554,20 @@ def script_tab(self,gesture):
552554 "kb:shift+tab" :"tab" ,
553555 }
554556
555- class OutlookWordDocument (WordDocument ):
557+
558+ class BaseOutlookWordDocument (BaseWordDocument ):
559+
560+ @script (gestures = ["kb:tab" , "kb:shift+tab" ])
561+ def script_tab (self , gesture ):
562+ bookmark = self .makeTextInfo (textInfos .POSITION_SELECTION ).bookmark
563+ gesture .send ()
564+ info , caretMoved = self ._hasCaretMoved (bookmark )
565+ if not caretMoved :
566+ return
567+ self .reportTab ()
568+
569+
570+ class OutlookWordDocument (WordDocument , BaseOutlookWordDocument ):
556571
557572 def _get_isReadonlyViewer (self ):
558573 # #2975: The only way we know an email is read-only is if the underlying email has been sent.
@@ -575,7 +590,7 @@ def _get_role(self):
575590 ignoreEditorRevisions = True
576591 ignorePageNumbers = True # This includes page sections, and page columns. None of which are appropriate for outlook.
577592
578- class OutlookUIAWordDocument (UIAWordDocument ):
593+ class OutlookUIAWordDocument (UIAWordDocument , BaseOutlookWordDocument ):
579594 """ Forces browse mode to be used on the UI Automation Outlook message viewer if the message is being read)."""
580595
581596 def _get_isReadonlyViewer (self ):
0 commit comments