Jonathin,

 

I too have had some issues with the accuracy of the text object as it
relates to text returned for a given location.  I reported these issues to
GW some time back, and as I recall, it was related to converting from
windows to screen coordinates.  In my app I wanted to get the text of the
current line as indicated by the cursor, and something was forcing me to go
through these conversion between units, and I was finding that sometimes the
text object would return an empty line, and I'd have to go up/down by a
pixel or two (after the conversion) before it would return the text of the
current line.  As I mention in class 15, it's not an entirely reliable way
to retrieve text; you can often do better using the clips collection.  But
if text is what you really need, do try adjusting your position up or down
by just a pixel if you're being returned an empty string, and then try a
second time.  This is what I eventually had to do in the "Word Advanced
Features" app in order to get text to give me the text of the current line.

 

Hth,

 

Chip

 

 

From: Jonathan Cohn [mailto:[email protected]] On Behalf Of Jonathan C.
Cohn
Sent: Sunday, September 15, 2013 6:15 PM
To: [email protected]
Subject: Re: text.nextline

 

Bruce,

 

Thanks for the class notes from Chip, everybody does have access to these
via the GWMicro web site, though I do appreciate the research efforts.

 

I was attempting to re-do some examples from jaws training to show to my
co-workers. One of the the labs moves the jaws cursor to the bottom of the
current window and then speaks the information.

 

I was able to do this fairly easily, but then realized that with the text
object I should be able to get data from any line on the screen without
moving either the mouse or we-cursor.

 

I got the outline windows rectangle converted that to a screen rectangle and
then asked for the line of text starting at the bottom right of the window.

 

I was finding that the function was recovering the line just below and to
the left of the current window. I had to remember  learn that I needed a
copy of the text object. 

 

I was not able to determine a good method to move just inside of the
outlines edge and just changed my starting point by 20 pixels vertically. I
was hoping that the text.priorline would work but had no success there.

 

   

Best wishes,

 

Jonathan

 

Reply via email to