Use Gem Button Control in OneNote to Execute VBS Script to Run External Program
2021-01-21 07:20
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.
Demonstration
Related Documents
- How to Select and Copy the Paragraphs Edited by a User in a OneNote Page?
- EXE: Create a Note of Outlook and Microsoft Sticky Notes Directly from OneNote
- EXE: Change OneNote Page Date Time to Outlook Item Date Time after Send to OneNote
- How do Respondents Use Content Controls to Fill Out OneNote Forms without Gem Installed?
- How to create A4 Frame with underlines Genko in OneNote?