Find current cursor position in Word problem 
Author Message
 Find current cursor position in Word problem

I have the following line of code that I'm running from a VBA module in
Access 2000:

lng=word.Selection.Information(wdHorizontalPositionRelativeToPage)

word is an object defined by:
Set Word = CreateObject("Word.Application.9")

Here's the issue I've run into:

If I precede the line of code with:
word.visible=true

then it works as expected and returns the position of the cursor, in
points from the left hand edge of the document.

If, however, I leave word "in"visible it returns -1.

Am I going to be forced to have Word visible to get this information or is
there another way to get what I'm after?



Mon, 11 Aug 2003 23:49:13 GMT  
 Find current cursor position in Word problem
Word has to be visible.  However, you can minimize it to the task bar so its
not intrusive.
--
Steve Arbaugh
ATTAC Consulting Group
http://ourworld.compuserve.com/homepages/attac-cg


Quote:
> I have the following line of code that I'm running from a VBA module in
> Access 2000:

> lng=word.Selection.Information(wdHorizontalPositionRelativeToPage)

> word is an object defined by:
> Set Word = CreateObject("Word.Application.9")

> Here's the issue I've run into:

> If I precede the line of code with:
> word.visible=true

> then it works as expected and returns the position of the cursor, in
> points from the left hand edge of the document.

> If, however, I leave word "in"visible it returns -1.

> Am I going to be forced to have Word visible to get this information or is
> there another way to get what I'm after?



Sat, 16 Aug 2003 12:32:23 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Finding Font and Attributes Used at Cursor Position (Like MS-Word)

2. cant find cursor position in a word app

3. current cursor position

4. get current cursor position

5. Return sentence index number from current cursor position

6. Need help on VB5 add-in for current cursor position

7. Get the current position of cursor in text box

8. Current cursor position in textbox

9. Place text at current cursor position

10. How do I find cursor position inside textbox?

11. Find and select from cursor position

12. how to find the current cursor line number

 

 
Powered by phpBB® Forum Software