gus
11 years agoContributor
Getting ribbon item via Items.Item() fails
Hi,
Based on the article at , I'm trying to get a reference to a specific ribbon item using the following JScript code:
Sys.Process("FooApp").WinFormsObject("MainWindow").WinFormsObject("ribbonControl1").Items.Item("Manage Projects").Caption
I'd expect this to return "Manage Projects", but instead I receive a type mismatch error.
The following code returns the Manage Projects caption correctly:
Sys.Process("FooApp").WinFormsObject("MainWindow").WinFormsObject("ribbonControl1").Items.Item(1).Caption
It looks like TestComplete or JScript would not accept the caption as the parameter of the Item method, unlike the documntation confirms this is a legal way to access items.
Can you tell me the mistake in the first code line? I get the same results if I use the aliases defined.
Thanks in advance
Gusztáv
Based on the article at , I'm trying to get a reference to a specific ribbon item using the following JScript code:
Sys.Process("FooApp").WinFormsObject("MainWindow").WinFormsObject("ribbonControl1").Items.Item("Manage Projects").Caption
I'd expect this to return "Manage Projects", but instead I receive a type mismatch error.
The following code returns the Manage Projects caption correctly:
Sys.Process("FooApp").WinFormsObject("MainWindow").WinFormsObject("ribbonControl1").Items.Item(1).Caption
It looks like TestComplete or JScript would not accept the caption as the parameter of the Item method, unlike the documntation confirms this is a legal way to access items.
Can you tell me the mistake in the first code line? I get the same results if I use the aliases defined.
Thanks in advance
Gusztáv