Programming with Reflection

image\rwnprg32.gif Session object



The Session object controls the Reflection session. All of Reflection's methods and properties act on the Session object.

Note: Prior to version 7.0, Reflection used the name Application for the Reflection object. If you are creating or maintaining Reflection Basic scripts, continue to use Application for the Reflection object name.

When you use a Reflection method, property, or event in a Visual Basic macro, precede it with Session and a period, or use a With statement to identify Session as the object. You can also use just the method or property name (with nothing preceding it), however this can cause conflicts if you have defined variables or procedures that use the same name as a Reflection method or property. The following three examples are equivalent:

This example shows how to use the Connect method preceded by the Session object name:


This example places the Connect method between With and End With statements:

 With Session


 End With

This example uses the Connect method unqualified by the Reflection object. (Note: If you have declared a variable named Connect, this statement will generate an error. If you have defined a Connect procedure, this statement will run that procedure.)



image\jump.gif Properties

image\jump.gif Methods

image\popup.gif Related Topics

image\popup.gif Reflection products that use this object