Customization of the Context Menu

Back to index page

The JChem context menu is available both in case of Microsoft Office Excel 2003 and in case of Microsoft Office Excel 2007.

 

Personal customization of the context menu

 

Open the JChemExcelContextMenu.xml file for edition.

 

Windows Vista: C:\Users\<CurrentUser>\AppData\Roaming\ChemAxon\JChem for Excel\JChemExcelContextMenu.xml

Windows XP: C:\Documents and Settings\<CurrentUser>\Application Data\ChemAxon\JChem for Excel\JChemExcelContextMenu.xml

 

Select a menu item which you want to hide from the context menu (e.g.: Add/Edit) and set its visibility to FALSE.

 

<button id="CM_AddEditStructureAction" visible="false" onAction="AddEditStructureAction" image="AddEditStructureAction.ico" caption="Add/Edit" tooltipText="Adds or edits structure in the selected cell." descriptionText="Add structure to or edit structure in the selected cell.__The structure editor specifed in the Options is used._" enabled="true"/>

 

Add some new actions (e.g.: ImportFileAction, ExportFileAction and ResizeStructuresToDefaultInSelectionAction) to the context menu. Add the new actions as new rows to a selected section of the JChemExcelContextMenu.xml file.

 

<button id="CM_ImportFileAction" visible="true" onAction="ImportFileAction" image="ImportFileAction.png" caption="Import from File" tooltipText="Import structures from file." descriptionText="Import structures from file." enabled="true"/>

<button id="CM_ExportFileAction" visible="true" onAction="ExportFileAction" image="ExportFileAction.png" caption="Export to File" tooltipText="Export structures to file." descriptionText="Export structures to file." enabled="true"/>

<button id="CM_ResizeStructuresToDefaultInSelectionAction" visible="true" onAction="ResizeStructuresToDefaultInSelectionAction" image="ResizeToDefault.png" caption="Resize to Default" tooltipText="Resize Structures To Default In Selection." descriptionText="Resize Structures To Default In Selection." enabled="true"/>

 

Save the modified xml file as JChemExcelContextMenu_Custom.xml.

 

Windows Vista: C:\Users\CurrentUser\AppData\Roaming\ChemAxon\JChem for Excel\JChemExcelContextMenu_Custom.xml

Windows XP: C:\Documents and Settings\CurrentUser\Application Data\ChemAxon\JChem for Excel\JChemExcelContextMenu_Custom.xml

 

Paste a ResizeToDefault.png file into the Images folder to provide an icon for the new buttons.

 

Windows Vista: C:\Users\CurrentUser\AppData\Roaming\ChemAxon\JChem for Excel\Images\ResizeToDefault.png

Windows XP: C:\Documents and Settings\CurrentUser\Application Data\ChemAxon\JChem for Excel\Images\ResizeToDefault.png

 

The ImportFileAction.png and ExportFileAction.png files exist in the Images folder by default.

The customized xml file (JChemExcelContextMenu_Custom.xml) is loaded automatically instead of the original xml file at starting Microsoft Excel if the customization is correct. The customized JChem for Excel context menu is available in Microsoft Excel. The "Add/Edit" menu item is hidden from the context menu but the "Import from File", "Export to File" and "Resize to Default" menu items are displayed in the context menu.

 

ContextMenu.Custom1

 

The original JChemExcelContextMenu.xml file is loaded automatically instead of the customized file at starting Microsoft Excel if there is any problem with the customization. Please check the log file for information in this case.

 

Corporate level customization of the context menu

 

The above described modifications has to be done in the original JChemExcelContextMenu.xml file and it has to be re-packed in installer.