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.
We create 2 VBS Script.
It will pop up a window showing Hello Word!
Let's drag and drop these 2 script files into the page and become attachments.
Click on “Hello World!” button on the OneNote page directly.
Gem will executes hellworld.vbs, which pops up “Hello World!” prompt window.
Just click the Calculator button on the OneNote page.
Gem will execute runcalc.vbs to open the Windows calculator.
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.
Create Hello Word! Button
- Click Gem’s Cooperation tab -> Controls -> Button Control. Gem will pop up “Gem Control Properties” window.
- In Title property, input: Hello World!
- In VBS property, click … button to choose the VBS file in OneNote page. Gem will pop “VBS Attach Files” window.
- In “VBS Attach Files” window, choose the helloworld.vbs attachment.
- Finally, click “OK” button. Gem will create a button in the cursor in OneNote page.
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.
Create a Calculator Button to Run Windows Calculator
- Click Gem’s Cooperation tab -> Controls -> Button Control. Gem will pop up “Gem Control Properties” window.
- In Title property, input: Calculator
- In VBS property, click … button to choose the VBS file in OneNote page. Gem will pop “VBS Attach Files” window.
- In “VBS Attach Files” window, choose the runcalc.vbs attachment.
- Finally, click “OK” button. Gem will create a button in the cursor in OneNote page.
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.