Take the 2-minute tour ×

I have a bot that is scanning my inbox periodically for specific emails. Whenever the code below is firing the cursor blinks and flashes when the cursor is over the Lotus Notes UI. Google returned about 5 results for my search and none of them seemed to address this issue. It's not preventing my program from working but it does look pretty bad aesthetically. Anyone out there have any ideas? Thanks!

*I also tagged this as C# to get more eyes looking at it. I'd prefer a vb.net solution but C# is welcome and appreciated as well.

    Dim NS As Object = CreateObject("Notes.NotesSession")
    Dim NDB As Object = NS.GetDatabase("", "")
    If NDB.IsOpen = False Then NDB.Openmail()
    Dim NV As Object = NDB.GetView("($Inbox)")
    Dim ND As Object = NV.GetFirstDocument
    Dim aItems As Array
    Dim dInfo As Dictionary(Of String, String)
    Dim EmailCount As Integer = NV.entrycount
    Dim iCurrent As Integer = 0
    Dim EmailDate As DateTime
    Dim Subject As String, Body As String, sFrom As String
        iCurrent += 1
        aItems = ND.Items
        dInfo = New Dictionary(Of String, String)
        For i As Integer = 0 To aItems.Length - 1
            If Not dInfo.ContainsKey(aItems(i).name) Then
                dInfo.Add(aItems(i).name, aItems(i).text)
            End If
        EmailDate = CDate(dInfo("DeliveredDate"))
        Subject = dInfo("Subject")
        Body = dInfo("Body")
        sFrom = dInfo("From")
        If NV.GetNextDocument(ND) Is Nothing Then Exit Do
        ND = NV.GetNextDocument(ND)
share|improve this question
I'm not sure why someone voted this as too local / unlikely to help anyone in the future. If this had been answered in the past it would be helping me right now! –  DontFretBrett Oct 29 '12 at 19:51
I agree. It should not be voted down. This confusion between the two sets of classes is fairly common, and yes, there are still people using and programming for Lotus Notes and Domino. –  Richard Schwartz Oct 29 '12 at 20:54
add comment

1 Answer

up vote 1 down vote accepted

The Notes.NotesSession class is an OLE class, which means that it interacts with the Notes UI.

You should be using the COM version of the class instead, which is Lotus.NotesSession

share|improve this answer
I tried switching it to Lotus.NotesSession and the Lotus Notes UI crashed. I'll see if I can find out where it crashed –  DontFretBrett Oct 29 '12 at 21:55
Ok it crashed on this line: Dim NDB As Object = NS.GetDatabase("", ""). I'll try supplying the Server and NSF mail file. *Edit: No luck. Any ideas? –  DontFretBrett Oct 29 '12 at 21:56
With the COM classes, you need to call NotesSession.Initialize(). See here: publib.boulder.ibm.com/infocenter/domhelp/v8r0/… –  Richard Schwartz Oct 29 '12 at 22:11
Initialize requires a password correct? The nice thing about the way I'm doing it now is that it requires no password or user interaction. The downfall, of course, is the flickering cursor. So my only 2 choices are prompt for a lotus password or deal with the blinking cursor? –  DontFretBrett Oct 30 '12 at 16:36
There is another choice, but it requires the users to change a setting in their Notes client setup to allow external programs to access their Notes data without entering a password. This setting does raise some security risks, so you would need to think carefully about whether or not to use it. In Notes 8, the setting is available under File - Security - User Security on the "Security Basics - Who You Are" tab, with the label "Don't prompt for password from other Notes-based programs". –  Richard Schwartz Oct 30 '12 at 18:07
show 4 more comments

Your Answer


