How can I programmatically switch focus from a custom task pane to the active word document?

Answered How can I programmatically switch focus from a custom task pane to the active word document?

All Replies

  • Monday, March 05, 2012 6:45 PM
     
     
    anyone?
  • Tuesday, March 06, 2012 8:13 AM
    Moderator
     
     Answered

    Hi,

    After lots of research on this, I can confirm what you said. Using Windows API does couldn't make the cursor back to the document window. But I find a workaround for this: you can put something like data collection, data inputting and data viewing into custom task pane. but if you put the action button within the ribbon, Word application could get back its cursor via calling Globals.ThisAddIn.Application.Selection.Select()

    You can download and check it from my skydrive:

    https://skydrive.live.com/redir.aspx?cid=53252f8e9d778685&resid=53252F8E9D778685!317&parid=53252F8E9D778685!153

    Please let me if this could fit your requirement.

    Good day,


    Calvin Gao[MSFT]
    MSDN Community Support | Feedback to us

  • Thursday, March 08, 2012 3:36 PM
     
     

    Thanks Calvin,

    the skydrive location is not working for me.

    Is there another way I can get that source code?

    Thanks for looking into this.

    Mel

  • Friday, March 09, 2012 2:30 AM
    Moderator
     
     

    Strange...I've already make the folder public, everybody should has the accessibility. But anyway, you can contact me via email at: v-caga_at_microsoft_dot_com, and I would send you back a sample project.

    I look forward to hearing of you.


    Calvin Gao[MSFT]
    MSDN Community Support | Feedback to us

  • Saturday, March 10, 2012 5:54 AM
     
     

    thanks Calvin,

    I was using Chrome browser and it was not working. Used IE and I got the zip file. I will look at the code.

    Thanks for your help!

    Mel