Example Code

Adding Custom Menu Using VB Script in DIAdem

Products and Environment

This section reflects the products and operating system used to create the example.

To download NI software, including the products shown below, visit ni.com/downloads.

    Software

  • Diadem

Code and Documents

Attachment

Description

This example shows you how to add Custom menu with icon.ico in VBScript.

How to Use

  • How to add custom menu :
    1. Open the Script tab of the DIAdem.
    2. Run the script, Add_Custom_Menu.VBS in attached file.
    3. A custom menu is created with the Car_icon.ico file icon and stored in the DIAdem setup file Desktop.DDD. This menu will persist when running DIAdem.
    4. The VBS file connected to the custom menu is Load_DIAdem_dialog.VBS. This VBS is the Dialog box that loads the Data portal data.
  • How to delete custom menu :
    1. Open the Script tab of the DIAdem.
    2. Run the script, Remove_Custom_Menu.VBS in attached file.
    3. The custom menu is deleted. And, the changed configuration is saved as desktop.DDD.

The custom menu created is as follows:

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.