OneNote Gem Add-Ins

Use Gem Button Control in OneNote to Execute VBS Script to Run External Program

Gem for OneNote provides button control that is primarily used to execute a VBS script attachment in the current OneNote page.
 
In this article, we'll open the calculator of windows systems by inserting a button control in OneNote to execute a VBS script.
That is, the calculator opens directly at the click of a button in OneNote.
 

VBS Script Attachment

 
We create 2 VBS Script.
 

helloworld.vbs script file

MsgBox "Hello World!"

 
It will pop up a window showing Hello Word!

helloworld.vbs
 

runcalc.vbs script file

 

On Error Resume Next
 
set wshshell=createobject ("wscript.shell" )
 
rem d=wshshell.run ("calc",3)
d=wshshell.run("c:\windows\system32\calc.exe",3)
 

it will run c:\windows\system32\calc.exe, Windows calculator.

 
runcalc.vbs

 
Let's drag and drop these 2 script files into the page and become attachments.

VBS Script Attachment


Create Hello Word! Button

 
  1. Click Gem’s Cooperation tab -> Controls -> Button Control. Gem will pop up “Gem Control Properties” window.
  2. In Title property, input: Hello World!
  3. In VBS property, click … button to choose the VBS file in OneNote page. Gem will pop “VBS Attach Files” window.
  4. In “VBS Attach Files” window, choose the helloworld.vbs attachment.
  5. Finally, click “OK” button. Gem will create a button in the cursor in OneNote page.
 
Create Hello Word! Button
 

Click "Hello World" Button, Pop Up "Hello World!" Prompt Window

 
Click on “Hello World!” button on the OneNote page directly.
Gem will executes hellworld.vbs, which pops up “Hello World!” prompt window.
 
Click "Hello World" Button, Pop Up "Hello World!" Prompt Window
 

Create a Calculator Button to Run Windows Calculator

 
  1. Click Gem’s Cooperation tab -> Controls -> Button Control. Gem will pop up “Gem Control Properties” window.
  2. In Title property, input: Calculator
  3. In VBS property, click … button to choose the VBS file in OneNote page. Gem will pop “VBS Attach Files” window.
  4. In “VBS Attach Files” window, choose the runcalc.vbs attachment.
  5. Finally, click “OK” button. Gem will create a button in the cursor in OneNote page.
 
 
 
Create a Calculator Button to Run Windows Calculator
 
 

Click “Calculator” Button to Run Windows Calculator

 
Just click the Calculator button on the OneNote page.
Gem will execute runcalc.vbs to open the Windows calculator.
 
 
Click “Calculator” Button to Run Windows Calculator
 

Demonstration

Use Gem Button Control in OneNote to Execute VBS Script to Run External Program


Download Gem for OneNote