Professional UI Solutions
Site Map   /  Register
 
 

Forum

Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Prof-UIS General Discussion » Change Menu name through ActiveX scripting using Prof-UIS Collapse All
Subject Author Date
jayender sivan Dec 23, 2005 - 10:38 PM

Hi, happen to come across ur samples in Prof-UIS  . well thats good. got few doubts. I saw ActiveX scripting. is it possible to chage the menu names through VB scripting? if yes how to do it ? say for example the menu has got File,View,Action,Help.now i got to change the name of the menu (File,View.. etc) to something like X,Y,Z .. through VB scripting at run time. how to do it ?


thanks,


jayender.

Technical Support Dec 24, 2005 - 10:55 AM

Please compile some Prof-UIS DLL configuration (any configuration of the profuisdll project without "RDE" in its name). For instance the "MBCS Debug" configuration generates the ProfUIS250md.dll file. Then please compile the same configuration of the ProfAuto project (ProfAuto250md.dll). The ProfAuto DLL should be registered because its type library is required for scripts in the ActiveScripts sample application:

regsvr32 ProfAuto250md.dll
Now please compile the ActiveScripts sample application and run it. Clear the content of the script editor window specified with the "Type your VB script here" tab and type only one line of VB script code in this editor:
AutoWindow.ActiveMenuBar.ActiveButtons.Item(0).CustomTextInToolbar = "RENAMED BUTTON"
Now you can click F5 key to run this code. You should see how it renames the first button with index set to zero in the menu bar. The "&File" button gets renamed to "RENAMED BUTTON".

jayender S Dec 25, 2005 - 9:44 PM

Well.. i tried this ... i gave


AutoWindow.ActiveMenuBar.ActiveButtons.Item(0).CustomTextInToolbar = "RENAMED BUTTON"


but when i run it i.e when i press F5, i get this error


An exception ’Runtime Error’ has occurred in Script.


Do you want to debug using selected debugger ?  (Yes or No button)


if i say no , then i get  this error:


Script Error:


Line: 2


Symbol :0


why is this? i gave the code which u gave . waiting for ur reply .


thanks,


Jayender.

Technical Support Dec 26, 2005 - 7:16 AM

We believe you simply forgot to register the COM type library of the Prof-UIS Automation Pack. Please register ProfAuto DLL you have compiled. For instance:

regsvr32 ProfAuto251md.dll
After invoking this from command line the type library information stored in the ProfAuto251md.dll file will be available for active scripts.

jayender S Dec 26, 2005 - 10:07 PM

It works .. Fine .. Thanks a lot dude. Yes i forgot to register the COM type library of the Prof-UIS Automation Pack. It works fine now thanks a lot. thanks,                                                                                                                                                                                                                    jayender