Article ID: 185697
Article Last Modified on 8/27/2007
Name: The name the script code can use to access the object.
Object: The object to be made available (late bound) to the script.
AddMembers: This is an optional argument. Default value is False.
If True, the methods and properties are available as
global functions and variables.
If False, the methods and properties are only available via
fully qualified object.member syntax.
Public Sub Prt (S)
Debug.Print S
End Sub
Private Sub Command1_Click()
Dim L as clsLog
Set L = New clsLog
With ScriptControl1
.Language = "VBScript"
.AllowUI = True
.AddObject "LoadLog", L, True
' True = expose Prt as global Sub
' "Loadlog" is executed immediately when Addcode loads the code.
Debug.Print "Adding the code"
.AddCode Text1.Text
Debug.Print "Finished adding the code"
.AddObject "RunLog", L
.Run "Test"
End With
End Sub
Sub Test
RunLog.Prt "RunLog is available after Load"
Prt "LoadLog exposes Prt as a global method"
End Sub
LoadLog.Prt "LoadLog is available during Load"
Additional query words: kbDSupport kbdse kbVBp400 kbVBp500 kbVBp600 kbVBA500 kbVBp kbActiveX kbAccess97 kbAccess700
Keywords: kbgrpdsvbdb kbhowto KB185697