Macro hides cursor; keeping focus at mid-screen

P

Paul B.

Hi,
I've got a macro with which I parse paragraphs to see which ones to
merge and which to skip. It's working well except for two problems.

First, after I either Merge or Skip and the macro then proceeds to the
next para, the cursor, not always, but more often than not, and
without any pattern that I've discerned, disappears. That plus Word's
advancing the text on the screen makes it very hard to know which para
I'm currently focusing on. So I'd like to ensure that the cursor is
always visible. You can see that I attempted this in the code below,
but to little or no avail:
___________________
(Merge button)
Private Sub CommandButton1_Click()
Selection.TypeBackspace
System.Cursor = WdCursorType.wdCursorNormal
Selection.MoveDown Unit:=wdParagraph, Count:=1
End Sub

(Skip button)
Private Sub CommandButton2_Click()
Selection.MoveDown Unit:=wdParagraph, Count:=1
System.Cursor = WdCursorType.wdCursorNormal
End Sub

(Exit button)
Private Sub CommandButton3_Click()
frmFindparCleanup.Hide
System.Cursor = WdCursorType.wdCursorNormal
End Sub
____________________

Secondly, it would be great if I could keep the cursor near the center
of the vertical scrolling area. Word places the active paragraph at
the bottom of the screen, making it hard to see the full context,
which is the name of the game when determining paragraph separation.

Thanks for any help you can give.
p.
 
P

Paul B.

Ok, I solved the disappearing cursor problem, by adding this little
jog to the code:

Selection.MoveRight Unit:=wdCharacter, Count:=1
Selection.MoveLeft Unit:=wdCharacter, Count:=1

Not sure why that's necessary, but anyway. Now if I can get the scroll
to stay vertically centered I will be home free.

p.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top