【发布时间】:2017-06-13 11:49:04
【问题描述】:
提前感谢您的帮助!
我最终会尝试根据主题行从特定电子邮件中提取信息。解决这个问题,下面的代码是一个提取主题行的测试。然而,它浏览了 132 个文档,没有一个主题被识别为空白以外的任何内容。使用相同的 Initialize 和 GetDatabase 方法,我成功地通过 Lotus Notes 发送了电子邮件,所以我不认为我在寻找错误的文档。下面通过 Excel 用 VBA 编写的代码有 Lotus Notes 8.5
任何人都知道我在浏览 Notes 数据库中的所有文档时只会得到空白的原因吗?
Sub LotusGetView()
Dim Nsess As New NotesSession
Dim Ndb As NotesDatabase
Dim Ndocs As NotesDocumentCollection
Dim Ndoc As NotesDocument, docNext As NotesDocument
Dim c As Long
Dim memSubj As Variant
Nsess.Initialize
Set Ndb = Nsess.GetDatabase("", "names.nsf")
Set Ndocs = Ndb.AllDocuments
c = 1
Set Ndoc = Ndocs.GetFirstDocument
Do Until Ndoc Is Nothing Or c = 1000
Set docNext = Ndocs.GetNextDocument(Ndoc)
memSubj = Ndoc.GetItemValue("Subject")(0)
If memSubj <> "" Then
MsgBox memSubj
End If
Call Ndoc.Remove(True)
Set Ndoc = docNext
c = c + 1
Loop
MsgBox c
End Sub
【问题讨论】:
标签: excel lotus-notes vba