Msscriptcontrol.scriptcontrol component Properties, methods, Events introduction _vbs

Source: Internet
Author: User
Tags instance method

Msscriptcontrol.scriptcontrol component Instance Object properties

Property name Type Note
Allowui BOOL Detects whether the user's interface element is allowed to run. If False, interface elements such as message boxes are not visible.
CodeObject Object The object that the script exposes to the host. Read-only.
Modules Modules The component library module that the host provides to the script. Read-only. (COM components usually provide the user with a collection of objects that can be left to the user two times in the form of object collection, one modules per collection)
Language String Sets or gets the language interpreted by the script engine, for example: VBScript, JScript.
Name String The name of the script engine. Read-only.
Procedures Procedures Returns a collection of procedures defined in a module
Sitehwnd HWND To display the UI's parent window handle in a script
State Enum Sets or returns the state of the control, and if 0, the control executes only the statement but does not forward the event, and for 1 the object that is accepted by the joined control.
Timeout Long The time-out value of the execution script for the control,-1 indicates no timeout
Usesafesubset BOOL Sets or returns whether the host program is concerned about security. The security level of the host program can be set from this property
Error Error Error object, when an error occurs, this property returns an Error object


Msscriptcontrol.scriptcontrol Component Instance method name

Method name Parameters Function
Addcode Code as String Add a script to the script engine to execute
AddObject Name as String, object as Object, [addmembers as Boolean = False] Add an object to the scripting engine so that the method provided by the object can be used in the script.
Eval Expression as String Evaluation of expressions
Executestatement Statement as String Interpreting and executing script statements
Reset Discard all objects and code, and set the state property to 0.
Run ProcedureName as String, ParamArray Parameters () as Variant To run a specified procedure

Msscriptcontrol.scriptcontrol Component Instance event name

Event name Function
Error Fires the event when an error occurs
TimeOut Occurs when the execution process times out

How to use Msscriptcontrol.scriptcontrol

1. Add ScriptControl in the program
2. Define a ScriptControl instance
3, call Addcode and other methods to the script engine to add the script to execute.
4, call run execution to execute the script function.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.