我有一个机器人正在定期扫描我的收件箱中的特定电子邮件。每当下面的代码触发时,光标闪烁并在光标位于Lotus Notes UI上时闪烁。 Google为我的搜索返回了大约5个结果,但似乎没有一个可以解决这个问题。它并没有阻止我的程序工作,但它在美学上看起来确实很糟糕。那里有人有什么想法吗?谢谢!
*我还将其标记为C#以让更多人注视它。我更喜欢vb.net解决方案,但C#也受到欢迎和赞赏。
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
答案 0 :(得分:1)
Notes.NotesSession
类是一个OLE类,这意味着它与Notes UI交互。
您应该使用该类的COM版本,即Lotus.NotesSession