views:

60

answers:

1

A bit of background: My program reads text from a number of applications so that handicapped or children can hear it. To do this, it has an internal buffer where the text is, and an internal representation of where the cursor is.

So, if the cursor is | the result for this line would be 21 (or thereabouts) :)

Now, to get the cursor position on a line, I would do "Selection.Range.Start" and then subtract an offset from where the line starts. However, "Selection.Range.Start" returns the cursor position with hidden chars. So if in the example "cursor" was a link to somewhere, then Word will add about 45-70 to the cursor position the momement the cursor entered the link "cursor". This doesnt work very well for my application as it now thinks the cursor is at the end of the line.

So, is there a way to get the cursor position in word without the hidden chars counted in as well?

A: 

Are you sure you choose the right tag? You are talking about a Visual Basic script here, right?

May be some of the macros on this page could help? What you have to find out is how to select a visible range, I guess.

Ashalynd