georgesOne
Technical User
Hi,
I want to transfer some data into an Access DB. The following code -found here - works well for the active lotus DB.
However, I have records in an archive DB which I would like to add. I can not manage the code to retrieve records from the archive, it always uses the main active DB in which the archive DB is included.
sPathToSave = "C:\DAS\gi\My Documents\LotusDocs\"
Set Session = CreateObject("Notes.Notessession")
Set MailDB = Session.GETDATABASE("C:\DAS\archive\",
"a_gi.nsf")
This is the path/name of an archive DB. The actual DB (which is opened with Lotus Notes) has adifferent path/name
I guess here is the problem.....
Call MailDB.openmail '????????????
Set View = MailDB.GETVIEW("($Inbox)")
Set nDoc = View.GetFirstDocument()
While Not (nDoc Is Nothing)
If nDoc.HasEmbedded Then
Set Itm = nDoc.GETFIRSTITEM("Body")
If Itm.Type = RICHTEXT Then
For Each EmbedObj In Itm.EmbeddedObjects
If (EmbedObj.Type = EMBED_ATTACHMENT) Then
rst.AddNew
rst![DocumentID] = nDoc.GETFIRSTITEM("$Orig").Text
.... and so on ....
rst.Update
EmbedObj.ExtractFile sPathToSave & EmbedObj.Name
End If
Next
End If
End If
End If
Set nDoc = View.GetNextDocument(nDoc)
Wend
Any help is appreciated.
Regards, Georges
I want to transfer some data into an Access DB. The following code -found here - works well for the active lotus DB.
However, I have records in an archive DB which I would like to add. I can not manage the code to retrieve records from the archive, it always uses the main active DB in which the archive DB is included.
sPathToSave = "C:\DAS\gi\My Documents\LotusDocs\"
Set Session = CreateObject("Notes.Notessession")
Set MailDB = Session.GETDATABASE("C:\DAS\archive\",
"a_gi.nsf")
This is the path/name of an archive DB. The actual DB (which is opened with Lotus Notes) has adifferent path/name
I guess here is the problem.....
Call MailDB.openmail '????????????
Set View = MailDB.GETVIEW("($Inbox)")
Set nDoc = View.GetFirstDocument()
While Not (nDoc Is Nothing)
If nDoc.HasEmbedded Then
Set Itm = nDoc.GETFIRSTITEM("Body")
If Itm.Type = RICHTEXT Then
For Each EmbedObj In Itm.EmbeddedObjects
If (EmbedObj.Type = EMBED_ATTACHMENT) Then
rst.AddNew
rst![DocumentID] = nDoc.GETFIRSTITEM("$Orig").Text
.... and so on ....
rst.Update
EmbedObj.ExtractFile sPathToSave & EmbedObj.Name
End If
Next
End If
End If
End If
Set nDoc = View.GetNextDocument(nDoc)
Wend
Any help is appreciated.
Regards, Georges