Article ID: 135076
Article Last Modified on 8/16/2005
'Function to trap ESC key
Declare Function GetAsyncKeyState Lib "USER32"(kState As Long) As Integer
Sub MAIN
DisableInput 'Disable ESC canceling macro
'and posting errmsg.
Dim dlg As FormatNumber : GetCurValues dlg 'Variable to hold new
'sequence number.
a$ = dlg.StartAt 'Prompt on status bar.
Line Input "Start numbering at: ", a$ 'If ESC is not pressed.
If GetAsyncKeyState(27) = 0 Then
FormatNumber .StartAt = Str$(Int(Val(a$))) 'This construction will trap
'for non-integer values.
'Number selected paragraphs
'beginning with number
'entered on status bar.
EndIf : End Sub
'Function to trap ESC key
Declare Function GetAsynchKeyState Lib "USER"(KState As Integer) As Integer
Sub MAIN
DisableInput 'Disable ESC canceling macro
'and posting errmsg.
Dim dlg As FormatNumber : GetCurValues dlg 'Variable to hold new
'sequence number.
a$ = dlg.StartAt 'Prompt on status bar.
Line Input "Start numbering at: ", a$ 'If ESC is not pressed.
If GetAsyncKeyState(27) = 0 Then
FormatNumber .StartAt = Str$(Int(Val(a$))) 'This construction will trap
'for non-integer values.
'Number selected paragraphs
'beginning with number
'entered on status bar.
EndIf : End Sub
WARNING: ANY USE BY YOU OF THE CODE PROVIDED IN THIS ARTICLE IS AT
YOUR OWN RISK. Microsoft provides this macro code "as is" without
warranty of any kind, either express or implied, including but not
limited to the implied warranties of merchantability and/or fitness
for a particular purpose.
Additional query words: 7.0 word95 format number numbers numbering word7 winword word6
Keywords: kbmacroexample KB135076