Hi Ivan,
You can get the number of items in the Document | Document Workflow submenu using the
wButtonCount property of the Aliases.PowerUserU.wndAfx2.Afx object. To get the item captions, use the
wButtonText property.
To check if a specific item exists in a submenu, you can loop through the submenu items and check the corresponding wButtonText property value. Something like this:
// Select the Document | Document Workflow menu item
...
// Check if the submenu contains the Start item
var menu = Aliases.PowerUserU.wndAfx2.Afx;
var found = false;
for (var i = 0; i < menu.wButtonCount; i++)
{
if (menu.wButtonText(i, true) == "Start")
{
found = true;
break;
}
}
if (found)
Log.Message("The submenu contains the 'Start' item.");
else
Log.Message("The submenu does not contain the 'Start' item.");