Globals Property (Scripting Object)

Object: Scripting Object

Access: Read-Only

Returns global name/key - value pairs. Use this property for script-to-script communications.

Note:

Multiple global variables are supported. The number of global variables is limited only by the available memory.

Usage

Scripting.Globals

Arguments

None

Return Values

Object. The Scripting Object.

Examples

To store a global name/key - value pair:

Scripting.Globals("MyGlobalName") = "MyGlobalValue"  
 

To read from a global name/key -value pair:

MsgBox Scripting.Globals("MyGlobalName")                                                                                      
’ Returns “MyGlobalValue” 
  

To store a global object:

Scripting.Globals.Data(“MyGlobalObjName”) = myObj 
 

To output the global object’s name:

MsgBox Scripting.Globals("MyGlobalObjName").Name  
’ Returns the value of myObj.Name  
 

To iterate the keys:

For Each key In Scripting.Globals.Keys 
    MsgBox key & "=" & Scripting.Globals(key) 
Next