IsUserCommandRegistered Method of the Commands Object
This method allows you to find out whether the specified user-defined command is registered. You can use this method to check availability of an enumeration constant before registering a custom command.
CommandId[in] Specifies a MenuItemEnum constant which corresponds to the user command.Result[out, retval] Specifies whether the command is registered. If the value is TRUE, such command has already been registered, and you cannot use this constant for another command.