
Tips.Net > WordTips Home > Macros > WordBasic Examples > Determining if Caps Lock is On with WordBasic
Summary: Your WordBasic macro may need to know if the Caps Lock key is on or not. Here's how to figure it out. (This tip works with Microsoft Word 6, and Word 95.)
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 WordBasic macro code determines the status of the Caps Lock key, and warns you accordingly:
If SelInfo(21) Then
Print "The Caps Lock key is on"
Else
Print "The Caps Lock key is off"
End If
Tip #732 applies to Microsoft Word versions: 6 95
Find and Replace Almost Anything! An invaluable resource for learning how to harness the full power of Word's search and replace capabilities. You'll discover everything you need in order to master all the intricacies of finding and replacing elements of your document, including the super-powerful "wildcard searches" available in Word.
Check out WordTips: Find and Replace today!
Uncover how you can master the full potential of printing your documents. Everything you wanted to know about printing and printers, using Word. (more information...)
Ask a Word Question
Make a Comment
Beauty Tips
Bugs and Pests Tips
Car Tips
Cleaning Tips
College Tips
Cooking Tips
Excel2007 Tips
ExcelTips
Family Tips
Gardening Tips
Health Tips
Home Tips
Money Tips
Organizing Tips
Pet Tips
Word2007 Tips
WordTips