0
在此先感谢您的帮助!使用VBA无法从Lotus Notes获取任何信息
我最终试图根据主题行从特定电子邮件中提取信息。解决这个问题,下面的代码是一个测试来拉出主题行。然而,它贯穿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
你是对的,找到了正确的数据库。感谢您的帮助! –