TAB Navigation failed in ADXTaskPane if Word shape is selected

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

TAB Navigation failed in ADXTaskPane if Word shape is selected
 
Subscribe
Daniel Lutz




Posts: 28
Joined: 2023-02-27
Hello support team,

it seems to be that an ADXTaskPane in MS Word doesn`t notified by Word when a shape is selected. I attached a zip file with a simple ADXComAddin for Word which create a ADXTaskPane instance with a usercontrol an some text boxes on it. To reproduce the behaviour you can load the addin and create a new document in word.

No Selection

1. Set focus on the first textbox
2. Switch focus with TAB or SHIFT+TAB between the textboxes

This works fine. Now create a shape an selected.

Shape Selection

1. Set focus on the first textbox
2. Switch focus with TAB. The first movement works and then it failed.

What i know is that Word ha a shortcut with TAB and SHIFT+TAB to navigate between shapes (selection) and after the first TAB navigation in the user control word seems to be avoid the messages to inform the adxpane. Is there any way to fix it on your side? (The builtin word panes works correctly.) It is complicated because this will be break completely keyboard navigation and prevent people with disabilities to work with our addin.

Best regards
Daniel

You will find the addin project behind this sharepoint link: https://axes4-my.sharepoint.com/:u:/p/d_lutz/IQB00Jasc-cYRKAyq8cfCwVtAdqBPq8whz0Uq1DDarWWv0I?e=U6L6pi

Please give me a hint if you have download it then i will disable it.
Posted 19 Dec, 2025 11:27:27 Top
Andrei Smolin


Add-in Express team


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

What Word version are you using?

I don't reproduce this on my machines having this Office build installed: Version 2511 (Build 19426.20218 Click-to-Run). This is Current Channel. That is, for me tabbing on the pane works uninterrupted; it doesn't wrap up, though: clicking TAB while being on the last textbox doesn't switch me to the first textbox.

Regards from Poland (GMT+2),

Andrei Smolin
Add-in Express Team Leader
Posted 23 Dec, 2025 11:24:24 Top
Daniel Lutz




Posts: 28
Joined: 2023-02-27
Hello Andrei,

it seems to be a problem inside our own addin is active. The first problem i could solve because we had in the SelectionChanged Event a cascade of methods call which process an event call. In this eventhandler we updated the ribbon ui after i block it it works again. The secound problem seems to be with the selection object. Everytime we use "Tab" to navigate in the example project i`ve send you the selectionchanged event from word is fired. If i handle this event and call Selection.ShapeRange it seems to be that after the secound tab it not works again.

Best regards
Daniel
Posted 23 Dec, 2025 13:09:49 Top
Daniel Lutz




Posts: 28
Joined: 2023-02-27
Okay i found the problem in our addin we process
AddinModule.OnKeyDown
handler. In this handler we look on the virtual key 9 which is tab and update manual our taskpanes (like the selection event it does) so it seems to be that in the context we must avoid this otherwise it blocks the navigation. (Maybe (untestet) it could be that we only hook in and not set the handled property)
Posted 05 Jan, 2026 09:16:14 Top
Andrei Smolin


Add-in Express team


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

Try to use the KeyDown event of the TaskPaneControl user control.

As far as I remember setting handled influences other hooks in the chain of hooks: they may remain non-called. I also assume Word sets hooks which are first hooks in the hook chain.

Regards from Poland (GMT+2),

Andrei Smolin
Add-in Express Team Leader
Posted 06 Jan, 2026 11:16:58 Top
Daniel Lutz




Posts: 28
Joined: 2023-02-27
Hello Andrei,

this was the point to avoid set
Handled
property. On of the issue was that when i handle the tab key in the AddinModule handler then i could be that the taskpanecontrol or the usercontrol get no keydown oder previewkeydown events for that key. It was very tricky.

Regards from Germany
Posted 06 Jan, 2026 13:32:40 Top
Andrei Smolin


Add-in Express team


Posts: 19198
Joined: 2006-05-11
Thank you, Daniel!

Regards from Poland (GMT+1),

Andrei Smolin
Add-in Express Team Leader
Posted 09 Jan, 2026 11:55:47 Top
Daniel Lutz




Posts: 28
Joined: 2023-02-27
Hello Andrei,

i must reopen this thread. Here https://axes4-my.sharepoint.com/:u:/p/d_lutz/IQCMEejP-pPAQLl6TEqEGLtoAYGxwpQ6YvrL-BfqkNL3TI0?e=UhO8Tb you will find a simple addin express example.

It contains a taskpane with an user control and 4 textboxes. After registration (no other COMAddin is loaded only the example addin) and word starting, i create a new document and a single shape on it. When nothing is selected i can navigate with TAB through the textboxes on the taskpane and can enter some text and navigate again. When i select the shape i can navigate through the textboxes with TAB until i input some characters after that the navigation is blocked until i reset the focus on the textbox with the mouse.

Can you reproduce the problem?. What i know is through the textbox_text_changed eventhandler i`ve updated the customxmlparts of the document. This occures the Word_Events_CommandBarsUpdate event. it seems to be when this happen AND the word shape is selected word blocks the navigation with TAB on the taskpane and try to navigate to the next shape on word.

Best regards
Posted 28 Jan, 2026 14:29:23 Top
Daniel Lutz




Posts: 28
Joined: 2023-02-27
I could reproduce it in a VM again. So it seems to be that the conditions are

1. A shape must be selected
2. With an event of an control inside the taskpane (like TextChanged) the Document.CustomXMLParts collection must be modified. This occurs an CommandBarsUpdate event (it is not necessary if i handle this event or not).

When both conditions are true the TAB navigation failed in the taskpane until i reset manual the focus again to the textbox with the mouse. It seems to be that the TAB keydown is not delegate to the taskpane. The source control have the focus this seems to be not the problem.

If no shape is selected all works right with navigation. If the shape is selected but the eventhandler in the taskpane doesn`t modify the documents property all navigation works also correct.
Posted 29 Jan, 2026 09:01:59 Top
Daniel Lutz




Posts: 28
Joined: 2023-02-27
It seems to be a Windows Forms problem. If i add an
ElementHost
to the usercontrol and use an WPF usercontrol with same logic (textboxes, textboxchanged eventhandler > change the CustomXMLParts collection and so on) it works.

Maybe you have an idea if there is an way to handle this.
Posted 02 Feb, 2026 12:03:00 Top