Annoyances.org
Home » Windows XP Discussion Forum » Message 1211491692 Search | Help | Home
  
re: Question about 'Force NumLock to Behave'
Thursday, May 22, 2008 at 2:28 pm
Windows XP Annoyances Discussion Forum
Posted by Chris O. (4 messages posted)


Here's another version of the VBS script I cobbled together.
I found that in my case at least launching an instance of Word when Word
was already running opens another Word window, screaming about
normal.dot already being in use. So this script checks first.

Tip of the hats for code tips to:
http://www.mvps.org/scripting/rube/index.htm
http://www.windowsitlibrary.com/Content/1258/09/1.html

If IsNumLocked = 0 Then
  NumLockOn
End If

Function NumLockOn()
set WshShell = CreateObject("WScript.Shell")
WshShell.SendKeys "{NUMLOCK}"
End Function

Function IsNumLocked()
Dim oWrd
Dim bWrdOff
bWrdOff = False



On Error Resume Next Set oWrd = GetObject(, "Word.Application") If Err Then Err.Clear Set oWrd = CreateObject("Word.Application") bWrdOff = True End If IsNumLocked = oWrd.Numlock If bWrdOff Then oWrd.Application.Quit True End If End Function In my situation my office PC is on and logged in 24-7, but for whatever reason (RDP?) the NumLock is off every morning. I added this to Scheduled Tasks to run every time the PC is idle for more than an hour.



Written in response to:
re: Question about 'Force NumLock to Behave' (Michael: Saturday, April 12, 2008 at 8:18 pm)

Responses to this message:
*re: Question about 'Force NumLock to Behave' (Chris O.: Thursday, May 22, 2008 at 2:55 pm)

All messages in this thread [show all]
-Question about 'Force NumLock to Behave' (Ann: Sun, Jun 9, 2002, 11:22 pm)
*re: Question about 'Force NumLock to Behave' (techno: Thu, Jun 13, 2002, 7:50 pm)
-re: Question about 'Force NumLock to Behave' (Jeff: Fri, Jun 21, 2002, 12:37 pm)
*re: Question about 'Force NumLock to Behave' (Lane Craig: Fri, Apr 25, 2003, 6:56 am)
*re: Question about 'Force NumLock to Behave' (Floyd: Sat, Jul 27, 2002, 7:09 pm)
-re: Question about 'Force NumLock to Behave' (Valerie: Tue, Aug 6, 2002, 9:07 am)
*re: Question about 'Force NumLock to Behave' (S. Lambert: Fri, Sep 6, 2002, 6:08 am)
*re: Question about 'Force NumLock to Behave' (Ianpb: Tue, Nov 5, 2002, 6:38 pm)
*re: Question about 'Force NumLock to Behave' (Jock McGuire: Sat, Feb 8, 2003, 5:00 am)
-re: Question about 'Force NumLock to Behave' (Random: Mon, Oct 15, 2007, 6:47 am)
-re: Question about 'Force NumLock to Behave' (will: Wed, Jan 16, 2008, 7:20 am)
*re: Question about 'Force NumLock to Behave' (Random: Sat, Jan 19, 2008, 10:31 am)
-re: Question about 'Force NumLock to Behave' (John Burns: Sun, Jul 4, 2004, 5:30 am)
-re: Question about 'Force NumLock to Behave' (Mike Jankowski: Sun, Apr 24, 2005, 12:21 pm)
*re: Question about 'Force NumLock to Behave' (Cheryl Clark: Mon, Apr 25, 2005, 5:47 pm)
*re: Question about 'Force NumLock to Behave' (System Analyst: Wed, Jul 11, 2007, 8:06 pm)
-re: Question about 'Force NumLock to Behave' (Mike Jankowski: Tue, Mar 11, 2008, 5:31 pm)
-re: Question about 'Force NumLock to Behave' (will: Wed, Mar 12, 2008, 10:09 am)
-re: Question about 'Force NumLock to Behave' (Mike Jankowski: Wed, Mar 12, 2008, 10:29 am)
-re: Question about 'Force NumLock to Behave' (Michael: Sat, Apr 12, 2008, 8:18 pm)
-re: Question about 'Force NumLock to Behave' (Chris O.: Thu, May 22, 2008, 2:28 pm)
*re: Question about 'Force NumLock to Behave' (Chris O.: Thu, May 22, 2008, 2:55 pm)
*re: Question about 'Force NumLock to Behave' (Michael Patten: Sun, May 8, 2005, 6:52 am)
*re: Question about 'Force NumLock to Behave' (Rob: Thu, Jun 28, 2007, 9:24 am)
Return to the Windows XP Discussion Forum

All content at Annoyances.org is Copyright © 1995-2008 Creative Elementtm All rights reserved.
Please do not plagiarize; redistributing these pages without permission is strictly prohibited.