cursor position in word 
Author Message
 cursor position in word

Hello,

First i need to save the cursor in word
I do this by:

xp = Selection.Information(wdFirstCharacterColumnNumber)
yp = Selection.Information(wdFirstCharacterLineNumber)

Then i process the word text, losing it's position,
but afterwards i have to set the position back to xp and yp.

Anyone knows how to do that?

Thanks,

Frank Scheldeman



Sun, 27 Jun 2004 19:03:51 GMT  
 cursor position in word
Hi Frank

Another way to do this is to insert a bookmark where you are positioned and
then return to bookmark (preferably also deleting it after return).

/BosseH



Quote:
> Hello,

> First i need to save the cursor in word
> I do this by:

> xp = Selection.Information(wdFirstCharacterColumnNumber)
> yp = Selection.Information(wdFirstCharacterLineNumber)

> Then i process the word text, losing it's position,
> but afterwards i have to set the position back to xp and yp.

> Anyone knows how to do that?

> Thanks,

> Frank Scheldeman




Sun, 27 Jun 2004 19:41:18 GMT  
 cursor position in word
Do you have an example of
how to do this??

Thanks in advance....

Frank.

Quote:

>Hi Frank

>Another way to do this is to insert a bookmark where you are positioned and
>then return to bookmark (preferably also deleting it after return).

>/BosseH



>> Hello,

>> First i need to save the cursor in word
>> I do this by:

>> xp = Selection.Information(wdFirstCharacterColumnNumber)
>> yp = Selection.Information(wdFirstCharacterLineNumber)

>> Then i process the word text, losing it's position,
>> but afterwards i have to set the position back to xp and yp.

>> Anyone knows how to do that?

>> Thanks,

>> Frank Scheldeman




Sun, 27 Jun 2004 20:23:46 GMT  
 cursor position in word
Mark the place where you are:

Selection.Bookmarks.Add Name:="MyPos"

Do whatever you want....

Return to your original place:

For Each BM In ActiveDocument.Bookmarks
    If BM.Name = "MyPos" Then
        Selection.GoTo What:=wdGoToBookmark, Name:=BM.Name
        BM.Delete
    End If
Next BM

/BosseH



Quote:
> Do you have an example of
> how to do this??

> Thanks in advance....

> Frank.


> >Hi Frank

> >Another way to do this is to insert a bookmark where you are positioned
and
> >then return to bookmark (preferably also deleting it after return).

> >/BosseH



> >> Hello,

> >> First i need to save the cursor in word
> >> I do this by:

> >> xp = Selection.Information(wdFirstCharacterColumnNumber)
> >> yp = Selection.Information(wdFirstCharacterLineNumber)

> >> Then i process the word text, losing it's position,
> >> but afterwards i have to set the position back to xp and yp.

> >> Anyone knows how to do that?

> >> Thanks,

> >> Frank Scheldeman




Sun, 27 Jun 2004 23:38:42 GMT  
 cursor position in word
Hi Bo,

Quote:
> For Each BM In ActiveDocument.Bookmarks
>     If BM.Name = "MyPos" Then
>         Selection.GoTo What:=wdGoToBookmark, Name:=BM.Name
>         BM.Delete
>     End If
> Next BM

This will do exactly the same:
With ActiveDocument.Bookmarks("MyPos")
    .Select
    .Delete
End With

Kind regards,
Perry



Quote:
> Mark the place where you are:

> Selection.Bookmarks.Add Name:="MyPos"

> Do whatever you want....

> Return to your original place:

> For Each BM In ActiveDocument.Bookmarks
>     If BM.Name = "MyPos" Then
>         Selection.GoTo What:=wdGoToBookmark, Name:=BM.Name
>         BM.Delete
>     End If
> Next BM

> /BosseH



> > Do you have an example of
> > how to do this??

> > Thanks in advance....

> > Frank.


> > >Hi Frank

> > >Another way to do this is to insert a bookmark where you are positioned
> and
> > >then return to bookmark (preferably also deleting it after return).

> > >/BosseH



> > >> Hello,

> > >> First i need to save the cursor in word
> > >> I do this by:

> > >> xp = Selection.Information(wdFirstCharacterColumnNumber)
> > >> yp = Selection.Information(wdFirstCharacterLineNumber)

> > >> Then i process the word text, losing it's position,
> > >> but afterwards i have to set the position back to xp and yp.

> > >> Anyone knows how to do that?

> > >> Thanks,

> > >> Frank Scheldeman




Mon, 28 Jun 2004 00:08:23 GMT  
 cursor position in word
Hi Perry

Sure, a more elegant way of doing it !

/BosseH



Quote:
> Hi Bo,

> > For Each BM In ActiveDocument.Bookmarks
> >     If BM.Name = "MyPos" Then
> >         Selection.GoTo What:=wdGoToBookmark, Name:=BM.Name
> >         BM.Delete
> >     End If
> > Next BM

> This will do exactly the same:
> With ActiveDocument.Bookmarks("MyPos")
>     .Select
>     .Delete
> End With

> Kind regards,
> Perry



> > Mark the place where you are:

> > Selection.Bookmarks.Add Name:="MyPos"

> > Do whatever you want....

> > Return to your original place:

> > For Each BM In ActiveDocument.Bookmarks
> >     If BM.Name = "MyPos" Then
> >         Selection.GoTo What:=wdGoToBookmark, Name:=BM.Name
> >         BM.Delete
> >     End If
> > Next BM

> > /BosseH



> > > Do you have an example of
> > > how to do this??

> > > Thanks in advance....

> > > Frank.


> > > >Hi Frank

> > > >Another way to do this is to insert a bookmark where you are
positioned
> > and
> > > >then return to bookmark (preferably also deleting it after return).

> > > >/BosseH


meddelandet

> > > >> Hello,

> > > >> First i need to save the cursor in word
> > > >> I do this by:

> > > >> xp = Selection.Information(wdFirstCharacterColumnNumber)
> > > >> yp = Selection.Information(wdFirstCharacterLineNumber)

> > > >> Then i process the word text, losing it's position,
> > > >> but afterwards i have to set the position back to xp and yp.

> > > >> Anyone knows how to do that?

> > > >> Thanks,

> > > >> Frank Scheldeman




Mon, 28 Jun 2004 14:47:07 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. Find current cursor position in Word problem

2. Cursor position in Word

3. Cursor Position in Word

4. Getting word toolbar to reflect context of cursor position

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

6. cant find cursor position in a word app

7. Word text cursor position

8. Cursor position

9. Cursor position in a module

10. Cursor position in a module

11. How do I find cursor position inside textbox?

12. Cursor position in text box

 

 
Powered by phpBB® Forum Software