How can I programmatically switch focus from a custom task pane to the active word document?
-
Monday, March 05, 2012 7:17 AM
I have a custom task pane that has a treeview.
I want the nodemouseclick() event to switch focus from the task pane to the active document so they can continue typing.
Is there a way to do that? I have looked at several approaches and none of them work.
http://social.msdn.microsoft.com/Forums/en/vsto/thread/68a228d3-24ff-4251-b953-ae369ba160c0
All Replies
-
Monday, March 05, 2012 6:45 PManyone?
-
Tuesday, March 06, 2012 8:13 AMModerator
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:
Please let me if this could fit your requirement.
Good day,
Calvin Gao[MSFT]
MSDN Community Support | Feedback to us
- Marked As Answer by Calvin_GaoModerator Friday, March 23, 2012 9:51 AM
-
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 AMModerator
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

