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)")
NV.refresh()
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
Do
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
Next
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)
Loop
The
Notes.NotesSessionclass 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