I'm attempting to automate the basic process of editing text in a TextFrame in Powerpoint via Interop, and I've hit a snag. I need to be able to begin the text editing process at a particular location on screen, and after crawling MSDN I still don't know of a way to do it. The use case boils down to this:
- My service receives an X and Y coordinate
- I tell Powerpoint to select the shape at that location
- I tell Powerpoint to place the blinking cursor at the location it would be if the user had clicked there himself to start editing text.
It's the third step that's tripping me up. Word has RangeFromPoint, which returns a text range. In Powerpoint, though, that method returns a shape. I can use TextRange.Characters() to place the cursor manually within the shape's text range, but that accepts character index values rather than screen coordinates.
Anyone know how to go about this (other than brute forcing in mouse messages via Win32 calls)?