Returned Values
You can assign returned property values to a variable. To do this, declare the variable using the data type for the property. (For Boolean properties, declare the variable as an integer.) In this example, the variable is used to store the value of the ConnectScript property:
Dim scriptName As String
scriptName = Session.ConnectScript
You can also use a returned property value directly in a statement or expression, as in these examples:
With Session
'Testing a boolean value
If .Connected = False Then .Connect
'Modifying an existing value
.Caption = .Caption & " Joe's Session"
'Using a value in a message box
MsgBox "The number rows in the display is " & .DisplayRows
End With