<%@ Language=VBScript %>
<HTML>
<HEAD>
<META NAME="; GENERATOR; " Content="; Microsoft; Visual; Studio; 6#; ">
</HEAD>
<BODY>
<%
Dim s 'As New NotesSession
Dim db 'As NotesDatabase
Dim v 'As NotesView
Dim vn 'As NotesViewNavigator
Dim e 'As NotesViewEntry
Dim doc 'As NotesDocument
Set s = CreateObject("Lotus.NotesSession")
Call s.Initialize
Dim serverName
serverName = ""
Set db = s.GetDatabase(serverName, "AllTypes.nsf")
Set v = db.GetView("All Documents")
Set vn = v.CreateViewNav()
Set e = vn.GetFirstDocument()
While Not (e Is Nothing)
Set doc = e.Document
Dim values, item1
Set item1 = doc.GetFirstItem("TextField")
values = item1.Values
Response.Write("<p>Subject: " + values(0) + "<br>")
Set item1 = doc.GetFirstItem("DateTimeField")
values = item1.Values
For Each dateTime In values
Response.Write("DateTime: " + CStr(dateTime))
Next
Set e = vn.GetNextDocument(e)
Wend
<HTML>
<HEAD>
<TITLE>Initialize Session</TITLE>
<SCRIPT LANGUAGE="VBScript">
Sub Button1_OnClick
dim s
Set s = CreateObject("Lotus.NotesSession")
Call s.Initialize
MsgBox s.CommonUserName,, "Common user name"
End Sub
</SCRIPT>
</HEAD>
<BODY>
<H3>Initialize Session and Print User Name</H3><HR>
<FORM><INPUT NAME="Button1" TYPE="BUTTON" VALUE="Click Here"></FORM>
</BODY>
</HTML>