Creating a session object

To access the Domino® Objects, create an object based on the registered Lotus®.NotesSession class.

Visual Basic

Include the Domino® object library in the Visual Basic project:

  • Choose Project - References.
  • Check "Lotus® Domino® Objects."

The location will show the path to DOMOBJ.TLB in the Domino® or Notes® program directory.

Alternatively, you can select the Browse button and specify DOMOBJ.TLB in the Domino® or Notes® program directory.

The Domino® Objects then become available to the project. You can see them in the Object Browser, and they appear as prompts when you start typing an object name.

The classes appear in the left-hand pane of the browser; the properties and methods appear in the pane for the selected class. Constants appear in the left-hand pane as Enum data structures; the members appear in the pane. For example, the Enum structure named ACLLEVEL contains the members ACLLEVEL_AUTHOR, ACLLEVEL_DEPOSITOR, and so on. The error constants appear in the pane when NOTES_ERRORS is selected in the left-hand pane.

To access the Domino® Objects, create a NotesSession object with either the following:

Dim session As New NotesSession

Or:

Dim session As NotesSession
Set session = CreateObject("Lotus.NotesSession")
Note: If you declare the session variable as Variant or Object, COM uses late binding.

VBScript

In VBScript, create a NotesSession object with the following:

Dim session
Set session = CreateObject("Lotus.NotesSession")

VBScript treats all variables as Variant, so COM uses late binding.

The Domino® constants are not defined. You must specify the actual values (or define the constants yourself). See the discussion of constant values in "Constants."

JScript and JavaScript

In JScript or JavaScript, create a NotesSession object with the following:

var session;
session = new ActiveXObject("Lotus.NotesSession");

JScript and JavaScript treat all variables as variants, so COM uses late binding.

The Domino® constants are not defined. You must specify the actual values (or define the constants yourself). See the discussion of constant values in "Constants."

Array return values must be converted using the toArray method of VBArray. For example:

var forms = new Array(256);
forms = VBArray(doc.GetItemValue("Form")).toArray();