Custom Command Events
Custom command events occur when a custom command is executed.
Custom command event sequence
The following events occur when a document is selected.
-
<CommandName>_State
The _State event determines what commands are available in the menu ribbon.
-
DocGenericEvent_OnProperties
The events that occur for custom commands are shown in the following list in the sequence that they occur.
-
DocGenericEvent_PrepareCommand
-
<CommandName>_PreInitialize
-
<CommandName>_Initialize
-
<CommandName>_BeforeWizard
-
<CommandName>_AfterWizard
-
<CommandName>_PreExecute
-
<CommandName>_Execute
-
<CommandName>_Terminate
<CommandName>_State Event
Occurs when the client application is calculating which custom commands should be available in the main menu, ribbon, or context menu.
Syntax
<CommandName>_State(Mode)
Name | Description |
---|---|
Mode |
Long integer that represents one or more AS_CMD_MODE constants. |
Remarks
Use this event to set the status of the menu item to a long integer that represents one or more AS_CMD_STATE constants.
<CommandName>_Initialize Event
Occurs before the command is executed.
Syntax
<CommandName>_Initialize(Batch)
Name | Description |
---|---|
Batch |
An object that represents the batch of documents the user has selected. |
<CommandName>_BeforeWizard Event
Occurs before a wizard page is shown.
Syntax
<CommandName>_BeforeWizard(Batch)
Name | Description |
---|---|
Batch |
An object that represents the batch of documents the user has selected. |
<CommandName>_AfterWizard Event
Occurs after a wizard page is shown.
Syntax
<CommandName>_AfterWizard(Batch)
Name | Description |
---|---|
Batch |
An object that represents the batch of documents the user has selected. |
<CommandName>_Execute Event
Occurs when the command is executed.
Syntax
<CommandName>_Execute(Batch)
Name | Description |
---|---|
Batch |
An object that represents the batch of documents the user has selected. |
Remarks
Use this event to execute the main logic of the command.
<CommandName>_PreExecute Event
Occurs before the command has been executed. This event is used to add a confirmation page to the command.
Syntax
<CommandName>_PreExecute(Batch)
Name | Description |
---|---|
Batch |
An object that represents the batch of documents the user has selected. |
Remarks
Refer to the AskConfirmation method documentation for the Batch object to learn how to create confirmation pages. You can also see examples of this functionality in this Knowledgebase article.
<CommandName>_PreInitialize Event
Occurs before the command is initialized. This event is used to add a confirmation page to the command.
Syntax
<CommandName>_PreInitialize(Batch)
Name | Description |
---|---|
Batch |
An object that represents the batch of documents the user has selected. |
Remarks
Refer to the AskConfirmation method documentation for the Batch object to learn how to create confirmation pages. You can also see examples of this functionality in this Knowledgebase article.