Written by Allen Wyatt (last updated August 31, 2022)
This tip applies to Word 2007, 2010, 2013, and 2016
When you are creating a macro, you may have a need to know if the Caps Lock key is engaged. (For instance, you may want to warn a user to turn the Caps Lock key off.) If you have this need, the following VBA macro code determines the status of the Caps Lock key, and warns you accordingly:
If Selection.Information(wdCapsLock) Then MsgBox "The Caps Lock key is on" Else MsgBox "The Caps Lock key is off" End If
Note:
WordTips is your source for cost-effective Microsoft Word training. (Microsoft Word is the most popular word processing software in the world.) This tip (11995) applies to Microsoft Word 2007, 2010, 2013, and 2016. You can find a version of this tip for the older menu interface of Word here: Determining if Caps Lock is On.
Comprehensive VBA Guide Visual Basic for Applications (VBA) is the language used for writing macros in all Office programs. This complete guide shows both professionals and novices how to master VBA in order to customize the entire Office suite for their needs. Check out Mastering VBA for Office 2010 today!
When you use a computer at work, that computer may be subject to periodic updating or replacement. If you want to protect ...
Discover MoreWord keeps track of identifying and statistical information about a document and makes that information available in the ...
Discover MoreNeed to run one macro from within another macro? You can easily do it by using the Run method of the Application object, ...
Discover MoreFREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."
2022-08-31 08:57:12
Al Stratford
For the Wordtip "Determining if Caps Lock is On" it apparently does not work on my MacOS older version of WORD:
(see Figure 1 below)
Any suggestions or comments appreciated.
Figure 1. screen shot of "About WORD" from my version
Got a version of Word that uses the ribbon interface (Word 2007 or later)? This site is for you! If you use an earlier version of Word, visit our WordTips site focusing on the menu interface.
Visit the WordTips channel on YouTube
FREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."
Copyright © 2023 Sharon Parq Associates, Inc.
Comments