Refresh screen after moving insertion point

J

Joe Ross

A simple question, I believe:

After building a Word doc via C# code, I'd like to move the cursor to the
top of the screen. I've done this with the following code:
wrdSelection.SetRange (0, 0);

This works, however, the screen doesn't refresh. So if the document is 3
pages long, the user is still staring at the bottom of page 3 even though
the cursor has moved to the top of page 1. I tried wrdApp.ScreenRefresh()
but that didn't do the trick.

Thanks for any help,
-joe
 
D

Doug Robbins - Word MVP

Hi Joe,

Use

ActiveWindow.ScrollIntoView Selection.Range, True

Please post any further questions or followup to the newsgroups for the
benefit of others who may be interested. Unsolicited questions forwarded
directly to me will only be answered on a paid consulting basis.

Hope this helps
Doug Robbins - Word MVP
 
J

Joe Ross

Worked perfectly...thanks!

-joe

Doug Robbins - Word MVP said:
Hi Joe,

Use

ActiveWindow.ScrollIntoView Selection.Range, True

Please post any further questions or followup to the newsgroups for the
benefit of others who may be interested. Unsolicited questions forwarded
directly to me will only be answered on a paid consulting basis.

Hope this helps
Doug Robbins - Word MVP
 

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