Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Find screen coordinates of a range -- Need help

Status
Not open for further replies.

NikosIEL

Programmer
Feb 18, 2005
3
GR
Hi

I'm trying to get the screen coordinates of selected words in a Microsoft Word 97 document so that I can display a small dialog box right under each selected word for spelling purposes. In Word 2000 and above that was easy because I could use the GetPoint function to get these coordinates, but I can't use it in Word'97. So far, I can get the coordinates of each selection relative to the page by using the Range.Information function, but I can't seem to be able to convert those to screen coordintates. I used the ClientToScreen api to do it by supplying the Word handle but it doesn't work right (which makes sense since the page's position in the window depends on the scrolling and zoom factor).

So, if anyone knows a way either to convert the relative to page coordinates into screen coordinates, OR an alternative way of getting screen coordinates of a selected word in a Word'97 document just like GetPoint does I would appreciate it if he could share it with me.

Many Thanks in advance

Nick
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top