I have an Extra! Basic macro that calls a VB script to take a screenshot. I would prefer to have all functions contained in the macro and not make outside calls to a VB script. The first two billets below are how it currently functions and the third is my failed attempted to eliminate the additional file. How can I embed VBS code into Extra Basic, or better yet, is there a more efficient way to take a screen shot within Extra Basic? I know screen shots are not the best way to grab data but that’s what has been requested of me.
- Extra Basic call:
Call Shell("Explorer.exe ""c:\screenShot.vbs")
- screenShot.vbs:
Set Wshshell=CreateObject("Word.Basic")
WshShell.AppActivate "AppName"
WshShell.sendkeys"%{prtsc}"
set WshShell = CreateObject("WScript.Shell")
WshShell.SendKeys "{NUMLOCK}"
- Failed embedding attempt:
Call Shell("Explorer.exe ""Set Wshshell=CreateObject('Word.Basic')")
Call Shell("Explorer.exe ""WshShell.AppActivate 'AppName'")
Call Shell("Explorer.exe ""WshShell.sendkeys'%{prtsc}'")
Call Shell("Explorer.exe ""set WshShell = CreateObject('WScript.Shell') ")
Call Shell("Explorer.exe ""WshShell.SendKeys '{NUMLOCK}'")
NOTE: The numlock was only added because the vbs kept turning it off after executing.