Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 08-06-2019, 04:58 AM
coolguyz coolguyz is offline Word VBA Script to Emulate Pressing Right Arrow Key Windows 10 Word VBA Script to Emulate Pressing Right Arrow Key Office 2019
Novice
Word VBA Script to Emulate Pressing Right Arrow Key
 
Join Date: Aug 2019
Posts: 3
coolguyz is on a distinguished road
Default Word VBA Script to Emulate Pressing Right Arrow Key

Hi I am developing education tools and need some help.



I want a Word VBA script to emulate someone pressing the right arrow key (so sort of scrolls down the document slowly) with the ability to change the amount of time this occurs.

This is to assist students learning languages where we want to keep going down the document as a slow but consistent speed.

Running on MS Office 2016.
Reply With Quote
  #2  
Old 08-06-2019, 05:48 AM
Guessed's Avatar
Guessed Guessed is offline Word VBA Script to Emulate Pressing Right Arrow Key Windows 10 Word VBA Script to Emulate Pressing Right Arrow Key Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 3,975
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

Try something like this
ActiveDocument.ActiveWindow.ActivePane.AutoScroll Velocity:=20
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote
  #3  
Old 08-06-2019, 06:35 AM
coolguyz coolguyz is offline Word VBA Script to Emulate Pressing Right Arrow Key Windows 10 Word VBA Script to Emulate Pressing Right Arrow Key Office 2019
Novice
Word VBA Script to Emulate Pressing Right Arrow Key
 
Join Date: Aug 2019
Posts: 3
coolguyz is on a distinguished road
Default

How do I run that?

Sorry I am a beginner at these things.
Reply With Quote
  #4  
Old 08-06-2019, 06:43 AM
coolguyz coolguyz is offline Word VBA Script to Emulate Pressing Right Arrow Key Windows 10 Word VBA Script to Emulate Pressing Right Arrow Key Office 2019
Novice
Word VBA Script to Emulate Pressing Right Arrow Key
 
Join Date: Aug 2019
Posts: 3
coolguyz is on a distinguished road
Default

Quote:
Originally Posted by Guessed View Post
Try something like this
ActiveDocument.ActiveWindow.ActivePane.AutoScroll Velocity:=20
OK I figured it out. But that scrolls down. I wanted it to emulate pressing the right arrow key.

I found something that says it is "vbKeyRight" here Keycode constants | Microsoft Docs

But I cannot figure out how to execute this.
Reply With Quote
  #5  
Old 08-06-2019, 03:57 PM
Guessed's Avatar
Guessed Guessed is offline Word VBA Script to Emulate Pressing Right Arrow Key Windows 10 Word VBA Script to Emulate Pressing Right Arrow Key Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 3,975
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

The problem with what you are asking is how do you intend to stop the macro. If you kick it off, the only way to stop it is to interrupt the code or put in a trigger to stop the macro.

How do you envisage to start or stop the continuous stepping?
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Word VBA Script to Emulate Pressing Right Arrow Key Toggle between upper case, lower case, etc... by one single macro on a Mac, to emulate Shift + F3 on gloub Word VBA 2 01-30-2019 12:40 PM
Word VBA Script to Emulate Pressing Right Arrow Key MS Word Horizontal Line Disappears after pressing Enter from end of line MikeWhite Word 5 01-20-2017 03:39 PM
Might it be possible to emulate the worksheet-based structure of Excel files in MS Word? Arabiflora Word 1 05-27-2016 11:50 PM
Left arrow won't work on Word LaBecs Word 2 09-26-2011 09:27 AM
How to get rid of arrow symbol in MS 2007 word? sjlee430 Word 0 09-18-2010 08:46 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 09:27 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