Skip to content
Thoughtful, detailed coverage of everything Apple for 34 years
and the TidBITS Content Network for Apple professionals
4 comments

Hack Microsoft Word’s Page Up/Page Down Keys

Microsoft Word has always screwed up the Page Up, Page Down, Home, and End keys on the Mac. I believe – and am willing to quote chapter and verse from the Apple Human Interface Guidelines to support my belief – that they should, respectively, scroll up one screen, scroll down one screen, scroll to the top of the document, and scroll to the bottom of the document. And they should do all this without moving the bloody insertion point!

Before Visual Basic for Applications went away, I wrote some macros that did this and reassigned the key commands. In Word 2008, however, there’s no VBA. So I finally figured out four one-line AppleScript scripts that bring back my desired scrolling behavior.

Copy each of these lines to a new document in AppleScript Editor (Snow Leopard) or Script Editor (Leopard) and save them in ~/Documents/Microsoft User Data/Word Script Menu Items, naming them, respectively, “Page Up”, “Page Down”, “Home”, and “End” (the exact names are important for later on). Files in this folder show up in the scripts menu in Word, which is the first step.

tell application "Microsoft Word" to large scroll active pane of active window up 1

tell application "Microsoft Word" to large scroll active pane of active window down 1

tell application "Microsoft Word" to set vertical percent scrolled of active pane of active window to 0

tell application "Microsoft Word" to set vertical percent scrolled of active pane of active window to 100

Then comes the problem of how to assign these scripts to the associated keys. You can’t use the Tools > Customize Keyboard command to assign keys to AppleScripts in Word. Microsoft’s advice is to put some magic key-equivalent crud at the end of the script’s file name (like “\smV” for Shift-Command-V, which I use for Paste Plain). But there’s nothing to type for the Page Up, Page Down, Home, and End keys. And, unfortunately, there’s no way to add Page Up, Page Down, Home, and End to any key in the Keyboard Shortcuts view of the Keyboard pane of System Preferences.

If you had a macro program like Keyboard Maestro, QuicKeys, or iKey, you could bind the scripts to the appropriate keys within Word. But what if you don’t have such a program? Once again, “defaults write” saves the day. In Terminal, first check to see if Word is listed in the results of this command (be sure to copy and paste each of these commands as a single line):

defaults read com.apple.universalaccess com.apple.custommenu.apps

If you don’t see “com.microsoft.Word” in there (you probably won’t), add it with this command:

defaults write com.apple.universalaccess com.apple.custommenu.apps -array-add "com.microsoft.Word"

Then, the magic happens with this last command:

defaults write com.microsoft.Word NSUserKeyEquivalents '{"Home" = "\UF729"; "End" = "\UF72B"; "Page Up" = "\UF72C"; "Page Down" = "\UF72D";}'

It’s probably best to quit and relaunch Word if it was running, but after all this, you should have Page Up, Page Down, Home, and End keys that scroll the text in view as expected, but without moving the insertion point.

Should you want to reverse the effects of these commands, the easiest way is to (in Snow Leopard) go into the Keyboard Shortcuts view of the Keyboard pane of System Preferences, select Application Shortcuts in the left-hand list, select Microsoft Word in the right-hand list, and click the minus button. (In Leopard, you’d look in the Keyboard view of the Keyboard & Mouse preference pane, and scroll down to the bottom to find Microsoft Word in the list of Application Keyboard Shortcuts.)


[Pete Resnick used to be a Macintosh programmer, and ostensibly knows something about email and the Internet. Now his entire career is reduced to giving presentations and talking to lawyers, hence his constant use of Microsoft Word.]

Subscribe today so you don’t miss any TidBITS articles!

Every week you’ll get tech tips, in-depth reviews, and insightful news analysis for discerning Apple users. For over 33 years, we’ve published professional, member-supported tech journalism that makes you smarter.

Registration confirmation will be emailed to you.

This site is protected by reCAPTCHA. The Google Privacy Policy and Terms of Service apply.

Comments About Hack Microsoft Word’s Page Up/Page Down Keys