Application.EnableCancelKey property (Word)
Returns or sets the way that Word handles CTRL+BREAK user interruptions. Read/write WdEnableCancelKey.
Syntax
expression. EnableCancelKey
expression Required. A variable that represents an Application object.
Remarks
Use this property very carefully. If you use wdCancelDisabled, there is no way to interrupt a runaway loop or other non - self-terminating code. Also, the EnableCancelKey property is not reset to wdCancelInterrupt when your code stops running; unless you explicitly reset its value, it will remain set to wdCancelDisabled for the duration of the Word session.
Example
This example disables CTRL+BREAK from interrupting a counter loop.
Dim intWait As Integer
Application.EnableCancelKey = wdCancelDisabled
For intWait = 1 To 10000
StatusBar = intWait
Next intWait
Application.EnableCancelKey = wdCancelInterrupt
See also
Support and feedback
Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.
피드백
https://aka.ms/ContentUserFeedback
출시 예정: 2024년 내내 콘텐츠에 대한 피드백 메커니즘으로 GitHub 문제를 단계적으로 폐지하고 이를 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은 다음을 참조하세요.다음에 대한 사용자 의견 제출 및 보기