|
|
|
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.
|
All messages in this thread [show all]
 |  |  |  |  |  |  |  | re: Question about 'Force NumLock to Behave' (Chris O.: Thu, May 22, 2008, 2:28 pm) |
| |
| |
Return to the Windows XP Discussion Forum
|
|
|
|