You are here: Programming guide > COM SDK fundamentals > Creating a command

Creating a command

You can add your own custom commands to the Document menu or context menu (right mouse-click). The definition of a custom command determines its name, icon, active state, and functionality. Follow these steps to create a command:

  1. In the Visual Basic Project Explorer, double-click the name of the interface extension designer in which you want to create the property. The Interface Extension design page appears.
  2. Click the Commands tab. The Commands tab appears as shown in the following figure.

  1. Click the Add new command  toolbutton. The Command (Menu Item) Properties dialog appears as shown in the following figure.

  1. Choose an appropriate setting for each option using the table below. Click OK when you are finished.
Command options
Option Description
Caption

This text will be displayed in the menu.

Internal Name

The internal name of the command will be used to generate the event that extends the code for the command.

Separator

Inserts a horizontal line in the menu.

Checked

Use this property to set the default state of the command depending on the state of the selected document.

Enabled

Use this property to set the default state of the command depending on the state of the selected document.

Visible

Use this property to set the default state of the command depending on the state of the selected document.

  1. Click the Edit command code  toolbutton or double-click the command name to open the command’s OnExecute procedure and add your own code.
(missing or bad snippet)

OnExecute method

OnLoadCommand method


www.bluecieloecm.com