finding screen pixel coordinates in Word document

D

David

Hello there!

I’m developing Office Add-in for Word Excel and PP. I use VC++ /COM /ATL.
My addin performs some GUI operations upon user request . At some point I
have to display graphical feedback to user, actually have to draw something
using DC and GDI. GDI operations should relate to the particular points on
the Word document (like specific line or word position on the document).
The only way I found in Word to get screen pixel coordinate is to use
Window object GetPoint function :
Returns the screen coordinates of the specified range or shape.
expression.GetPoint(ScreenPixelsLeft, ScreenPixelsTop, ScreenPixelsWidth,
ScreenPixelsHeight, obj)
However there are some problems using this function
1. It is very slow and memory consuming and I have to call this function
really a LOT of times!!!
2. This function works only with existing shape or range object on the
document. I have to know pixel coordinates of specific point on the document
given this point/inch/millimeter coordinates ( there are no shapes on this
document at all)
I think this is enough to rule out this function. I have spent a lot of
time searching MSDN, Google and other resources; however it was all in vain.
I will be extremely thankful for any idea, input.
Regards David
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top