Vic,

I believe one problem is that it should say OnHotKey instead of
OnCursorKey; I can't find any OnCursorKey documented.

Chip






------------------------------

Chip Orange
Database Administrator
Florida Public Service Commission

[email protected]
(850) 413-6314

 (Any opinions expressed are solely those of the author and do not
necessarily reflect those of the Florida Public Service Commission.)
 

> -----Original Message-----
> From: Vic Beckley [mailto:[email protected]] 
> Sent: Saturday, January 31, 2009 3:29 PM
> To: [email protected]
> Subject: OnCursorKey Event
> 
> Can anyone tell me why this script will not work?
> 
>  
> 
> Dim CursorKeyEvent : CursorKeyEvent = 
> ConnectEvent(Application, "OnCursorKey", "OnCursorKey")
> 
>  
> 
> Function OnCursorKey(CursorKeyId, isBeforeAction, 
> defaultActionAborted)
> 
>        If isBeforeAction Then
> 
> Dim objAction1 : Set objAction1 = CursorKeyId.FirstAction
> 
> Dim objAction2 : Set objAction2 = CursorKeyId.SecondAction
> 
> Dim strAction1 : strAction1 = objAction1.ActionID
> 
> Dim strAction2 : strAction2 = objAction2.ActionID
> 
>                Speak strAction1
> 
>                Speak strAction2
> 
>        End If
> 
>        OnCursorKey = False
> 
> End Function
> 
>  
> 
> I get this error when I use a cursor key with the script running.
> 
>  
> 
> CursorKeyTest.vbs - Microsoft VBScript runtime error
> 
> Line 7 Column 18
> 
> Object doesn't support this property or method: 'objAction1.ActionID'
> 
>  
> 
> < 0x800A01B6 >
> 
>  
> 
> Vic
> 
>  
> 
> 

Reply via email to