Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 04-04-2024, 07:25 AM
eduzs eduzs is offline Move cursor Windows 10 Move cursor Office 2019
Expert
Move cursor
 
Join Date: May 2017
Posts: 262
eduzs is on a distinguished road
Default Move cursor

How to move cursor to top of 1st paragraph of the current visible part of de active document view with vba? Thanks.
__________________
Backup your original file before doing any modification.
Reply With Quote
  #2  
Old 04-04-2024, 10:09 AM
vivka vivka is offline Move cursor Windows 7 64bit Move cursor Office 2016
Competent Performer
 
Join Date: Jul 2023
Posts: 227
vivka is on a distinguished road
Default

Hi, eduzs! If the visible part is the active doc, use the following code to move the cursor to the doc's start:
Code:
    selection.HomeKey wdStory
If you mean a part of the doc shown on the screen, I doubt there's a way to move the cursor to the top of the screen.
Reply With Quote
  #3  
Old 04-04-2024, 10:24 AM
eduzs eduzs is offline Move cursor Windows 10 Move cursor Office 2019
Expert
Move cursor
 
Join Date: May 2017
Posts: 262
eduzs is on a distinguished road
Default

Thanks, but this brings to the top of the document.
I want to move the selection to the top of current view area.
Example:
Open document with 10 pages, pagedown till page 5, at this point I see page 5 in the screen, but the cursor is still in the page 1.
I want to move the cursor to the top most paragraph/position of the visible range of text.
__________________
Backup your original file before doing any modification.
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Move cursor UserForm : Allow user to move cursor in document Souriane Word VBA 2 06-07-2021 12:58 PM
VBA Find a string and move the cursor to it mdlewis Word VBA 3 02-13-2020 03:53 AM
macro to auto move cursor to start column byron Excel Programming 7 12-23-2019 05:38 AM
Move cursor move cursor anand Word VBA 14 07-07-2015 05:57 AM
can't move the cursor in Word pieboy Word 2 02-13-2009 07:15 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 11:04 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft