I am working on customizing a menu. One of the menu choices is called Favorites, and you can have up to 9 favorite items in this submenu. I have a function that will rename the 9 items and make them visible (if you only have 6 then only 6 are visible). Your favorite is stored in an array that contains the menu option you want to select.
For example, variable gm_menu_favs[1] = m_mdi_frame.m_report.m_all_sales. The menu text Favorites\Favorite1 has been changed to Sales Report.
When Favorites\Sales Report is selected, in the clicked event I want to execute this script.
gm_menu_favs[1].triggerevent(Clicked!)
however this will not work as it says "Invalid operand type for Dot operator:string
Makes sense, but how do I create a menu object and identifiy the menu item I want to trigger?
this also does not work.
menu lm_this
lm_this = this
lm_this.gs_menu_favs[1].triggerevent(Clicked!)
Thanks
In the above comment, you have mentioned as below.
What you can do: Use the Item property of a menu to get its child items. So you can find a item by its classname.
e.g.
FOR ll_menu = 1 TO UpperBound (lm_current.Item)
IF lm_current.Item [ll_menu].Classname() = "m_fav1" THEN
...
END IF
NEXT
May I know, where this code should be written?
Thanks.
You can write it in a script where you want to call menu items code (as in the original question).