I am trying to identify grayed or disabled menu items from the main menu bar of my application. So for example, I have an app that has the following menu path: Guest->Guest Messages->Text
With the above path, Guest Messages is grayed out. When I attempt to run the following 'if' condition, the QTP script attempts to invoke the menu until it gives an "object is disabled" error:
If VbWindow("frmGuestApp").WinMenu("Menu").GetItemPro perty("&Guest;&Guest Messages", "Enabled") = "True" Then
msgbox "Not enabled!"
This code works perfectly on all the other menu items in the app. However, the problem arises only when I have a greyed out menu item which contains a sub menu.
Any ideas on resolving this issue?
I have been caught out by this before - try using the 'greyed' property. From what I gather from some developers they grey out the menu item rather than disable it.
If you had to identify, in one word, the reason
why the human race has not achieved, and never
will achieve, its full potential that word would be "meetings".
I'm not seeing documentation on the 'greyed' property name. I tried the following and get a "parameter is incorrect" error:
If VbWindow("frmGuestApp").WinMenu("Menu").GetItemPro perty("&Guest;&Guest Messages", "greyed") = "True" Then
Am I missing something??
Please respond to my request...no drive-by responses please