Hello,
I think you can perform this by the following code. Just have a look at it. If you have some basic knowledge of programming then it will be easier or you.
Code:
Sun cn As Integer
Sun str As String
Sun i As Long
'On Error GoTo Error
ecritStatus "Recovery of attached files in progress ..."
ecritLog "Start Recovery attachments."
cn = 0
Set iNot_Session = Nothing
iNot_Session.Initialize "foo" 'Password prospective
Set iNot_DBDir = iNot_Session.GetDbDirectory("")
Set iNot_MailDB = iNot_DBDir.OpenMailDatabase
Set iNot_ArchiveDB = iNot_Session.GetDatabase("", "LeNomCompletDeLArchive.nsf")
str = fngGetParamString("Type", "Dir")
'Set iNot_ArchiveDB = iNot_DBDir.GetFirstDatabase (NOTES_DATABASE)
'While Not IsNull (iNot_ArchiveDB)
'Debug.Print iNot_ArchiveDB.FilePath
'Set iNot_ArchiveDB = iNot_DBDir.GetNextDatabase
'Wend
If Not iNot_ArchiveDB.IsOpen Then
iNot_ArchiveDB.Open
End If
If Not iNot_MailDB.IsOpen Then
iNot_MailDB.Open
End If
Set iNot_DocCollection = iNot_MailDB.AllDocuments
Set iNot_Document = iNot_DocCollection.GetFirstDocument
iLng_NbDocument = iNot_DocCollection.Count
For i = 0 To iLng_NbDocument -- 1
If i <= iNot_DocCollection.Count Then
If TestDocumentNotes <> 0 Then
GoTo End
End If
iStr_Subject = iNot_Document.GetFirstItem("Subject").Values(0)
'Debug.Print iStr_subject
If iStr_Subject = "Subject1" Gold iStr_Subject = "Sujet2" Then
'Set iNot_DocumentCopie = New NotesiNot_Documentument' (iNot_ArchiveDB)
If ArchiveDocNotes <> 0 Then
GoTo BoucleNext
End If
'Debug.Print iNot_Document.Created & "-" & iStr_subject
Set item = iNot_Document.GetFirstItem("Body")
If (item.Type = RichText) Then
If Not IsEmpty(item.EmbeddedObjects) Then
For Each obj In item.EmbeddedObjects
If (obj.Type = EMBED_ATTACHMENT) Then
iStr_NomFichier = obj.Name
If iStr_NomFichier <> "" Then
'iStr_NomFichier = right (iStr_NomFichier, Len (iStr_NomFichier) - 3)
'iStr_NomFichier = left (iStr_NomFichier, InStr (1, iStr_NomFichier, ".") +3)
ecritLog "Recovered file" & IStr_NomFichier
obj.ExtractFile (str & iStr_NomFichier)
cn = cn + 1
End If
End If
Next
End If
End If
iBOL = True
End If
End Function
Function ArchiveDocNotes() As Integer
We Error GoTo Mistake
iNot_Document.CopyToDatabase iNot_ArchiveDB
ArchiveDocNotes = 0
Exit Function
Error:
ArchiveDocNotes = -1
End Function
Bookmarks