XLL+ Class Library

CXlMenu::AddItem

Adds a menu item

[C++]
void AddItem(
   const char* pszText,
   const char* pszMacro,
   const char* pszDescription = 0
);

Parameters

pszText

The text of the new menu item, which may include an ampersand for a short-cut key.

To create a separator item, with no text, pass "-" as pszText.

This argument can contain a resource ID string. This will be replaced at run-time by a string loaded from the resource file in the current preferred language, as returned by XllGetStringLanguageID.

pszMacro

The name of the macro function which will be called by the menu. This should be marked in the XLL+ Function Wizard as a macro function.

pszDescription

Optional description which will appear on the status bar in some versions of Excel.

This argument can contain a resource ID string. This will be replaced at run-time by a string loaded from the resource file in the current preferred language, as returned by XllGetStringLanguageID.

Remarks

Adds an item to the menu.

Unlike any of the other item methods, this function may be called either before or after Create() has been called.

Requirements

Header: xlmenu.h

See Also

CXlMenu Class | CXlMenu Methods