10

I have developed a Word Add-in using word java script API. When i click in Task pane to do some action the cursor focus removes from current document, i am not able to edit the document until click back on the document. Please advice me how i can set back cursor focus back to current document when doing some actions in Task Pane.

Thanks.

Philip Rueker
  • 948
  • 5
  • 15
user3931619
  • 267
  • 4
  • 14
  • 2
    Just for the record: As @JuanBalmori stated it's currently not possible for Office Add-ins. For legacy COM or VSTO add-ins you can use a workaround involving sending an F10 keystroke twice to the main window. This will put the focus back to the main document: `System.Windows.Forms.SendKeys.SendWait("{F10}"); System.Windows.Forms.SendKeys.SendWait("{F10}");` – Dirk Vollmar Oct 10 '16 at 14:57
  • In now times is it possible or not or any event for get focus on document after click on taskpane?. – Shiv Yadav Feb 03 '23 at 09:04

1 Answers1

8

This is not possible to do today. The user needs to click back in the document so it gets the focus.

Juan Balmori
  • 4,898
  • 1
  • 8
  • 17