rebol [ Title: "MS Script Control" File: %MSScriptControl.r Date: 29-Jun-2006 Version: 1.0.0 Progress: 0.6 Status: "working" Needs: [] Author: "Anton Rolls" Language: "English" Purpose: {MSScriptControl} Usage: {} History: [ 1.0.0 [6-Jun-2006 {First version converted from Ben's} "Anton"] ] ToDo: { - Try Java as well ! } Notes: {This is based on scriptctl.c from the DispHelper samples_c directory} ] if error? set/any 'error try [ ; catch all errors do/args %../COMLib.r [ ; Use the COMLib API functions here ;Scripting MS_script: CreateObject "MSScriptControl.ScriptControl" PutValue [MS_script ".Language = %s" "VBScript"] ;can we have a UI ? PutValue [MS_script ".AllowUI = %s" "TRUE"] ;can we execute not safe code ? PutValue [MS_script ".UseSafeSubset = %s" "0"] ;who are we talking to ? CallMethod [MS_script "_AboutBox()"] ;can you do this ? CallMethod [MS_script ".Eval(%s)" {MsgBox("Hola mundo!" & vbcrlf & "From REBOL thru VBScript !", 64)}] ;Let me choose some thing ! num: GetInteger [MS_script ".Eval(%s)" {MsgBox("do you like rebol?", 64 or 4)}] either num = 6 [ CallMethod [MS_script ".Eval(%s)" {MsgBox("Huray !", 64)}] ][ CallMethod [MS_script ".Eval(%s)" {MsgBox("Bhuooo !", 64)}] ] ; lets see if VBScript can sum two numbers :) num: GetInteger [MS_script ".Eval(%s)" "2 + 2"] print ["VBScript says 2 + 2 is: " num] release MS_script ] ][ print mold disarm error ]