事件代码 (Visio)Event codes (Visio)

使用**Add** 或**AddAdvise** 方法时, 请使用下表查找要创建的事件的事件代码。When you are working with the Add or AddAdvise method, use the following table to find the event code for the event that you want to create. 此表列出了每个 Visio 事件及其对应的事件代码和数字代码。This table lists each Visio event and its corresponding event code and numeric code.

备注

如果使用的是 Visual Basic 或 Visual Basic for Applications (VBA), 则无需创建自己的事件。If you are using Visual Basic or Visual Basic for Applications (VBA), you don't need to create your own events. 请参阅本参考中对应于要使用的事件的事件主题。See the event topic in this reference that corresponds to the event that you want to use.

事件及对应事件代码和数值代码表Table of events and corresponding event and numeric codes

事件Event 事件代码Event code 数值代码Numeric code
AfterModalAfterModal visEvtApp + visEvtAfterModalvisEvtApp+visEvtAfterModal &H1040 (4160)&H1040 (4160)
AfterResumeAfterResume visEvtCodeAfterResumevisEvtCodeAfterResume &H00D1 (209)&H00D1 (209)
AfterResumeEventsAfterResumeEvents visEvtCodeAfterResumeEventsvisEvtCodeAfterResumeEvents &H00D5 (213)&H00D5 (213)
AfterRemoveHiddenInformationAfterRemoveHiddenInformation visEvtRemoveHiddenInformationvisEvtRemoveHiddenInformation &H000A (11)&H000A (11)
AppActivatedAppActivated visEvtApp + visEvtAppActivatevisEvtApp+visEvtAppActivate &H1001 (4097)&H1001 (4097)
AppDeactivatedAppDeactivated visEvtApp + visEvtAppDeactivatevisEvtApp+visEvtAppDeactivate &H1002 (4098)&H1002 (4098)
AppObjActivatedAppObjActivated visEvtApp + visEvtObjActivatevisEvtApp+visEvtObjActivate &H1004 (4100)&H1004 (4100)
AppObjDeactivatedAppObjDeactivated visEvtApp + visEvtObjDeactivatevisEvtApp+visEvtObjDeactivate &H1008 (4104)&H1008 (4104)
BeforeDataRecordsetDeleteBeforeDataRecordsetDelete visEvtDel + visEvtDataRecordsetvisEvtDel+visEvtDataRecordset &H4020 (16416)&H4020 (16416)
BeforeDocumentCloseBeforeDocumentClose visEvtDel + visEvtDocvisEvtDel+visEvtDoc &H4002 (16386)&H4002 (16386)
BeforeDocumentSaveBeforeDocumentSave visEvtCodeBefDocSavevisEvtCodeBefDocSave &H0007 (7)&H0007 (7)
BeforeDocumentSaveAsBeforeDocumentSaveAs visEvtCodeBefDocSaveAsvisEvtCodeBefDocSaveAs &H0008 (8)&H0008 (8)
BeforeMasterDeleteBeforeMasterDelete visEvtDel + visEvtMastervisEvtDel+visEvtMaster &H4008 (16392)&H4008 (16392)
BeforeModalBeforeModal visEvtApp + visEvtBeforeModalvisEvtApp+visEvtBeforeModal &H1020 (4128)&H1020 (4128)
BeforePageDeleteBeforePageDelete visEvtDel + visEvtPagevisEvtDel+visEvtPage &H4010 (16400)&H4010 (16400)
BeforeQuitBeforeQuit visEvtApp + visEvtBeforeQuitvisEvtApp+visEvtBeforeQuit &H1010 (4112)&H1010 (4112)
BeforeSelectionDeleteBeforeSelectionDelete visEvtCodeBefSelDelvisEvtCodeBefSelDel &H0385 (901)&H0385 (901)
BeforeShapeDeleteBeforeShapeDelete visEvtDel + visEvtShapevisEvtDel+visEvtShape &H4040 (16448)&H4040 (16448)
BeforeShapeTextEditBeforeShapeTextEdit visEvtCodeShapeBeforeTextEditvisEvtCodeShapeBeforeTextEdit &H0323 (803)&H0323 (803)
BeforeStyleDeleteBeforeStyleDelete visEvtDel + visEvtStylevisEvtDel+visEvtStyle &H4004 (16388)&H4004 (16388)
BeforeSuspendBeforeSuspend visEvtCodeBeforeSuspendvisEvtCodeBeforeSuspend &H00D0 (208)&H00D0 (208)
BeforeSuspendEventsBeforeSuspendEvents visEvtCodeBeforeSuspendEventsvisEvtCodeBeforeSuspendEvents &H00D4 (212)&H00D4 (212)
BeforeWindowClosedBeforeWindowClosed visEvtDel + visEvtWindowvisEvtDel+visEvtWindow &H4001 (16385)&H4001 (16385)
BeforeWindowPageTurnBeforeWindowPageTurn visEvtCodeBefWinPageTurnvisEvtCodeBefWinPageTurn &H02BF (703)&H02BF (703)
BeforeWindowSelDeleteBeforeWindowSelDelete visEvtCodeBefWinSelDelvisEvtCodeBefWinSelDel &H02BE (702)&H02BE (702)
CalloutRelationshipAddedCalloutRelationshipAdded visEvtCodeCalloutRelationshipAddedvisEvtCodeCalloutRelationshipAdded &H01F8 (504)&H01F8 (504)
CalloutRelationshipDeletedCalloutRelationshipDeleted visEvtCodeCalloutRelationshipDeletedvisEvtCodeCalloutRelationshipDeleted &H01F9 (505)&H01F9 (505)
CellChangedCellChanged visEvtMod + visEvtCellvisEvtMod+visEvtCell &H2800 (10240)&H2800 (10240)
ConnectionsAddedConnectionsAdded visEvtAdd + visEvtConnectvisEvtAdd+visEvtConnect &H8100 (33024)&H8100 (33024)
ConnectionsDeletedConnectionsDeleted visEvtDel + visEvtConnectvisEvtDel+visEvtConnect &H4100 (16640)&H4100 (16640)
ContainerRelationshipAddedContainerRelationshipAdded visEvtCodeContainerRelationshipAddedvisEvtCodeContainerRelationshipAdded &H01F6 (502)&H01F6 (502)
ContainerRelationshipDeletedContainerRelationshipDeleted visEvtCodeContainerRelationshipDeletedvisEvtCodeContainerRelationshipDeleted &H01F7 (503)&H01F7 (503)
ConvertToGroupCanceledConvertToGroupCanceled visEvtCodeCancelConvertToGroupvisEvtCodeCancelConvertToGroup &H038C (908)&H038C (908)
DataRecordsetAddedDataRecordsetAdded visEvtAdd + visEvtDataRecordsetvisEvtAdd+visEvtDataRecordset &H8020 (32800)&H8020 (32800)
DataRecordsetChangedDataRecordsetChanged visEvtMod + VisEvtDataRecordsetvisEvtMod+VisEvtDataRecordset &H2020 (8224)&H2020 (8224)
DesignModeEnteredDesignModeEntered visEvtCodeDocDesignvisEvtCodeDocDesign &H0006 (6)&H0006 (6)
DocumentAddedDocumentAdded visEvtAdd + visEvtDocvisEvtAdd+visEvtDoc &H8002 (32770)&H8002 (32770)
DocumentChangedDocumentChanged visEvtMod + visEvtDocvisEvtMod+visEvtDoc &H2002 (8194)&H2002 (8194)
DocumentCloseCanceledDocumentCloseCanceled visEvtCodeCancelDocClosevisEvtCodeCancelDocClose &H0010 (10)&H0010 (10)
DocumentCreatedDocumentCreated visEvtCodeDocCreatevisEvtCodeDocCreate &H0001 (1)&H0001 (1)
DocumentOpenedDocumentOpened visEvtCodeDocOpenvisEvtCodeDocOpen &H0002 (2)&H0002 (2)
DocumentSavedDocumentSaved visEvtCodeDocSavevisEvtCodeDocSave &H0003 (3)&H0003 (3)
DocumentSavedAsDocumentSavedAs visEvtCodeDocSaveAsvisEvtCodeDocSaveAs &H0004 (4)&H0004 (4)
EnterScopeEnterScope visEvtCodeEnterScopevisEvtCodeEnterScope &H00CA (202)&H00CA (202)
ExitScopeExitScope visEvtCodeExitScopevisEvtCodeExitScope &H00CB (203)&H00CB (203)
FormulaChangedFormulaChanged visEvtMod + visEvtFormulavisEvtMod+visEvtFormula &H3000 (12288)&H3000 (12288)
GroupCanceledGroupCanceled visEvtCodeCancelSelGroupvisEvtCodeCancelSelGroup &H038E (910)&H038E (910)
KeyDownKeyDown visEvtCodeKeyDownvisEvtCodeKeyDown &H02C8 (712)&H02C8 (712)
KeyPressKeyPress visEvtCodeKeyPressvisEvtCodeKeyPress &H02C9 (713)&H02C9 (713)
KeyUpKeyUp visEvtCodeKeyUpvisEvtCodeKeyUp &H02CA (714)&H02CA (714)
MasterAddedMasterAdded visEvtAdd + visEvtMastervisEvtAdd+visEvtMaster &H8008 (32776)&H8008 (32776)
MarkerEventMarkerEvent visEvtApp + visEvtMarkervisEvtApp+visEvtMarker &H1100 (4352)&H1100 (4352)
MasterChangedMasterChanged visEvtMod + visEvtMastervisEvtMod+visEvtMaster &H2008 (8200)&H2008 (8200)
MasterDeleteCanceledMasterDeleteCanceled visEvtCodeCancelMasterDelvisEvtCodeCancelMasterDel &H0191 (401)&H0191 (401)
MouseDownMouseDown visEvtCodeMouseDownvisEvtCodeMouseDown &H02C5 (709)&H02C5 (709)
MouseMoveMouseMove visEvtCodeMouseMovevisEvtCodeMouseMove &H02C6 (710)&H02C6 (710)
MouseUpMouseUp visEvtCodeMouseUpvisEvtCodeMouseUp &H02C7 (711)&H02C7 (711)
MustFlushScopeBeginningMustFlushScopeBeginning visEvtCodeBefForcedFlushvisEvtCodeBefForcedFlush &H00C8 (200)&H00C8 (200)
MustFlushScopeEndedMustFlushScopeEnded visEvtCodeAfterForcedFlushvisEvtCodeAfterForcedFlush &H00C9 (201)&H00C9 (201)
NoEventsPendingNoEventsPending visEvtApp + visEvtNonePendingvisEvtApp+visEvtNonePending &H1200 (4608)&H1200 (4608)
OnKeystrokeMessageForAddonOnKeystrokeMessageForAddon visEvtCodeWinOnAddonKeyMSGvisEvtCodeWinOnAddonKeyMSG &H02C4 (708)&H02C4 (708)
PageAddedPageAdded visEvtAdd + visEvtPagevisEvtAdd+visEvtPage &H8010 (32784)&H8010 (32784)
PageChangedPageChanged visEvtMod + visEvtPagevisEvtMod+visEvtPage &H2010 (8208)&H2010 (8208)
PageDeleteCanceledPageDeleteCanceled visEvtCodeCancelPageDelvisEvtCodeCancelPageDel &H01F5 (501)&H01F5 (501)
QueryCancelConvertToGroupQueryCancelConvertToGroup visEvtCodeQueryCancelConvertToGroupvisEvtCodeQueryCancelConvertToGroup &H038B (907)&H038B (907)
QueryCancelDocumentCloseQueryCancelDocumentClose visEvtCodeQueryCancelDocClosevisEvtCodeQueryCancelDocClose &H0009 (9)&H0009 (9)
QueryCancelGroupQueryCancelGroup visEvtCodeQueryCancelSelGroupvisEvtCodeQueryCancelSelGroup &H038D (909)&H038D (909)
QueryCancelMasterDeleteQueryCancelMasterDelete visEvtCodeQueryCancelMasterDelvisEvtCodeQueryCancelMasterDel &H0190 (400)&H0190 (400)
QueryCancelPageDeleteQueryCancelPageDelete visEvtCodeQueryCancelPageDelvisEvtCodeQueryCancelPageDel &H01F4 (500)&H01F4 (500)
QueryCancelQuitQueryCancelQuit visEvtCodeQueryCancelQuitvisEvtCodeQueryCancelQuit &H00CC (204)&H00CC (204)
QueryCancelSelectionDeleteQueryCancelSelectionDelete visEvtCodeQueryCancelSelDelvisEvtCodeQueryCancelSelDel &H0387 (903)&H0387 (903)
QueryCancelStyleDeleteQueryCancelStyleDelete visEvtCodeQueryCancelStyleDelvisEvtCodeQueryCancelStyleDel &H012C (300)&H012C (300)
QueryCancelSuspendQueryCancelSuspend visEvtCodeQueryCancelSuspendvisEvtCodeQueryCancelSuspend &H00CE (206)&H00CE (206)
QueryCancelSuspendEventsQueryCancelSuspendEvents visEvtCodeQueryCancelSuspendEventsvisEvtCodeQueryCancelSuspendEvents &H0528 (210)&H0528 (210)
QueryCancelUngroupQueryCancelUngroup visEvtCodeQueryCancelUngroupvisEvtCodeQueryCancelUngroup &H0389 (905)&H0389 (905)
QueryCancelWindowCloseQueryCancelWindowClose visEvtCodeQueryCancelWinClosevisEvtCodeQueryCancelWinClose &H02C2 (706)&H02C2 (706)
QuitCanceledQuitCanceled visEvtCodeCancelQuitvisEvtCodeCancelQuit &H00CD (205)&H00CD (205)
RunModeEnteredRunModeEntered visEvtCodeDocRunningvisEvtCodeDocRunning &H0005 (5)&H0005 (5)
RuleSetValidatedRuleSetValidated visEvtCodeRuleSetValidatedvisEvtCodeRuleSetValidated &H000D (13)&H000D (13)
SelectionAddedSelectionAdded visEvtCodeSelAddedvisEvtCodeSelAdded &H0386 (902)&H0386 (902)
SelectionChangedSelectionChanged visEvtCodeWinSelChangevisEvtCodeWinSelChange &H02BD (701)&H02BD (701)
SelectionDeleteCanceledSelectionDeleteCanceled visEvtCodeCancelSelDelvisEvtCodeCancelSelDel &H0388 (904)&H0388 (904)
SelectionMovedToSubprocessSelectionMovedToSubprocess visEvtCodeSelectionMovedToSubprocessvisEvtCodeSelectionMovedToSubprocess &H000B (12)&H000B (12)
ShapeAddedShapeAdded visEvtAdd + visEvtShapevisEvtAdd+visEvtShape &H8040 (32832)&H8040 (32832)
ShapeChangedShapeChanged visEvtMod + visEvtShapevisEvtMod+visEvtShape &H2040 (8256)&H2040 (8256)
ShapeDataGraphicChangedShapeDataGraphicChanged visEvtShapeDataGraphicChangedvisEvtShapeDataGraphicChanged &H0327 (807)&H0327 (807)
ShapeExitedTextEditShapeExitedTextEdit visEvtCodeShapeExitTextEditvisEvtCodeShapeExitTextEdit &H0324 (804)&H0324 (804)
ShapeLinkAddedShapeLinkAdded visEvtShapeLinkAddedvisEvtShapeLinkAdded &H0325 (805)&H0325 (805)
ShapeLinkDeletedShapeLinkDeleted visEvtShapeLinkDeletedvisEvtShapeLinkDeleted &H0326 (806)&H0326 (806)
ShapeParentChangedShapeParentChanged visEvtCodeShapeParentChangevisEvtCodeShapeParentChange &H0322 (802)&H0322 (802)
ShapesDeletedShapesDeleted visEvtCodeShapeDeletevisEvtCodeShapeDelete &H0321 (801)&H0321 (801)
StyleAddedStyleAdded visEvtAdd + visEvtStylevisEvtAdd+visEvtStyle &H8004 (32772)&H8004 (32772)
StyleChangedStyleChanged visEvtMod + visEvtStylevisEvtMod+visEvtStyle &H2004 (8196)&H2004 (8196)
StyleDeleteCanceledStyleDeleteCanceled visEvtCodeCancelStyleDelvisEvtCodeCancelStyleDel &H012D (301)&H012D (301)
SuspendCanceledSuspendCanceled visEvtCodeCancelSuspendvisEvtCodeCancelSuspend &H00CF (207)&H00CF (207)
SuspendEventsCanceledSuspendEventsCanceled visEvtCodeCancelSuspendEventsvisEvtCodeCancelSuspendEvents &H00D3 (211)&H00D3 (211)
TextChangedTextChanged visEvtMod + visEvtTextvisEvtMod+visEvtText &H2080 (8320)&H2080 (8320)
UngroupCanceledUngroupCanceled visEvtCodeCancelUngroupvisEvtCodeCancelUngroup &H038A (906)&H038A (906)
ViewChangedViewChanged visEvtCodeViewChangedvisEvtCodeViewChanged &H02C1 (705)&H02C1 (705)
VisioIsIdleVisioIsIdle visEvtApp + visEvtIdlevisEvtApp+visEvtIdle &H1400 (5120)&H1400 (5120)
WindowActivatedWindowActivated visEvtApp + visEvtWinActivatevisEvtApp+visEvtWinActivate &H1080 (4224)&H1080 (4224)
WindowCloseCanceledWindowCloseCanceled visEvtCodeCancelWinClosevisEvtCodeCancelWinClose &H02C3 (707)&H02C3 (707)
WindowOpenedWindowOpened visEvtAdd + visEvtWindowvisEvtAdd+visEvtWindow &H8001 (32769)&H8001 (32769)
WindowChangedWindowChanged visEvtMod + visEvtWindowvisEvtMod+visEvtWindow &H2001 (8193)&H2001 (8193)
WindowTurnedToPageWindowTurnedToPage visEvtCodeWinPageTurnvisEvtCodeWinPageTurn &H02C0 (704)&H02C0 (704)

支持和反馈Support and feedback

有关于 Office VBA 或本文档的疑问或反馈?Have questions or feedback about Office VBA or this documentation? 请参阅 Office VBA 支持和反馈,获取有关如何接收支持和提供反馈的指南。Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.