T O P I C R E V I E W |
peter.cook |
Posted - 09/16/2005 : 12:35:19 PM Origin Version (Select Help-->About Origin): 7.5SR5 Operating System: Win 2000
Hi,
Can anyone please advise how I can control the menu level when opening Origin (via Excel VBA) as an automation server?
Cheers,
Pete
|
5 L A T E S T R E P L I E S (Newest First) |
peter.cook |
Posted - 09/19/2005 : 08:33:21 AM Hi Mike, Easwar, Greg,
Thanks for your inputs.
I'm familiar with the menu configurations as that helps define our customised client set ups and will use, where I need to, eg
LT_execute(" win -i; // minimise active window menu -e 32769; // set to level 2 menu -z; // restore active window ")
Cheers,
Pete
Edited by - peter.cook on 09/19/2005 08:36:26 AM |
Mike Buess |
Posted - 09/16/2005 : 2:53:16 PM The ID range for menu levels is from 32768 to 32777 so I use 'menu -e 32767 + menuLevel' to change the level via script during an Origin session. Works fine as long as these two conditions are met...
1. The project must contain at least one child window, otherwise the Format menu will not be showing and the menu -e command will not work.
2. The active window cannot be maximized.
Mike Buess Origin WebRing Member |
easwar |
Posted - 09/16/2005 : 2:31:06 PM Hi,
I don't think there is a way to pass a command line argument to the server application when you launch it as an automation server?
Pete, so you may either need to modify the Origin.ini file, or issue (multiple) script commands to Origin server after launching it, as described in Greg's post.
Easwar OriginLab
|
Mike Buess |
Posted - 09/16/2005 : 2:21:59 PM Can't he use the '-l menuLevel' command line argument?
Mike Buess Origin WebRing Member |
greg |
Posted - 09/16/2005 : 2:10:42 PM Menus are configured by the ORIGIN.INI file. You can create your own INI file and pass it as an argument on a command line (or the SHELL in VB) using the -i switch. Menu Levels can be selected in the Format : Menu menu option.
Key points about the INI ... Origin determines the number of menu levels by reading 'NumLevels': [CONFIG] NumLevels=2
Origin will start with the level specified by the keyword 'Level' in the [Options] section.
For each numbered level, Origin reads Title# in the [Config] section to know what to display in Format : Menu, and reads the File# to determine which configuration files to read. For example ...
Title1=Full Menus File1=Macros FullMenu
... reads the MACROS.CNF and FULLMENU.CNF when the user selects Format : Menu : Full Menus. (Origin does this at startup if Level keyword is 1.)
Your configuration file can modify the menus however you like. Note that each child window type has its own menu structure which can be edited.
Here is script which removes all Worksheet, Graph and Matrix menus. menu -wgpm; menu -r ?Fi; menu -r ?Ed; menu -r ?Vi; menu -r ?To; menu -r ?Fo; menu -r ?Wi; menu -r ?He; menu -wg; menu -r ?Pl; menu -r ?An; menu -w; menu -r ?Co; menu -r ?St; menu -g; menu -r ?Da; if(@v>4.2) menu -r ?Gr; menu -m; menu -r 1; menu -r ?Ma; menu -p; menu -r ?La; if(@V>7.0) menu -r ?Im;
... and this restores the menus: menu.cleanup();
You need to change active windows to see the effect of each of the above scripts.
|