Tuesday, May 01, 2012 12:05 PM
I have developed a VSTO using visual studio 2010 for office word. The version of Word is 2010.
I want to get keybord position, the following. How to get keybord position.
( C# 4.0 / Word 2010/ Visual Studio 2010 )
thanks in advance.
- Edited by vsmmma Tuesday, May 01, 2012 3:08 PM
Tuesday, May 01, 2012 4:48 PM
The Word Primary Interop Assemblies (PIAs) don't provide for that....hopefully someone can still help you, though.
Good diagram. Helpful, also, is the word 'caret' (in terms of Word programming this is also referred to with the terms 'insertion point' and 'selection').
Tuesday, May 01, 2012 9:06 PMModerator
The only thing the Word object model offers is the ActiveWindow.GetPoint method for the Range object. It's not 100% accurate but might help you...
Cindy Meister, VSTO/Word MVP
Tuesday, May 01, 2012 9:17 PMDo ranges have a GetPoint method (or a 'Windows' property)? It's not listed on MSDN (as a range member) and my VS intellisense won't pick it up.
- Edited by JosephFox Tuesday, May 01, 2012 9:19 PM
Wednesday, May 02, 2012 2:37 AM
Thank you for your help, JosephFox, Cindy Meister.
I could succeed.
Thank you very much.
my code ...
Word.Range r = Globals.ThisAddIn.Application.Selection.Range; int left, top, width, height; Globals.ThisAddIn.Application.ActiveWindow.GetPoint(out left, out top, out width, out height, r);
Wednesday, May 02, 2012 2:06 PMAh, I see! I guess I'm a little slower than you and Cindy.
- Edited by JosephFox Wednesday, May 02, 2012 2:07 PM punctuation change