1 mai 2012 12:05
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.
- Editat de vsmmma 1 mai 2012 15:08
1 mai 2012 16:48
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').
1 mai 2012 21:06Moderator
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
1 mai 2012 21:17Do 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.
- Editat de JosephFox 1 mai 2012 21:19
2 mai 2012 02:37
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);
2 mai 2012 14:06Ah, I see! I guess I'm a little slower than you and Cindy.
- Editat de JosephFox 2 mai 2012 14:07 punctuation change