0

我有一个机器人定期扫描我的收件箱以查找特定的电子邮件。每当下面的代码触发光标时,光标在 Lotus Notes UI 上方时会闪烁。谷歌为我的搜索返回了大约 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
4

1 回答 1

1

该类Notes.NotesSession是一个 OLE 类,这意味着它与 Notes UI 交互。

您应该改用该类的 COM 版本,即Lotus.NotesSession

于 2012-10-29T20:53:17.577 回答