par Dawood » 13 Nov 2009 à 16:43
Alors: voici enfin le résultat qui fonctionne. je pose le code pour les gens comme moi qui chercherait à détacher massivement les pièces jointes dans les messages d'une boite aux lettres, les déposer dans un répertoire réseau, et supprimer la pièce jointe en question. Ce code fonctionne sur un client V8.5
il suffit de coller ce code dans initialize, et modifier le chemin réseau de votre répertoire
------------------------------------------------
Sub initialize
Dim session As New NotesSession
Dim db As NotesDatabase
Dim docs As NotesDocumentCollection
Dim doc As NotesDocument
Dim rtitem As Variant
On Error Goto erreur
Set db = session.CurrentDatabase
If Not( db Is Nothing ) Then
Set docs = db.UnprocessedDocuments
If Not( docs Is Nothing ) Then
If( docs.Count > 0 ) Then
Set doc = docs.GetFirstDocument()
While Not( doc Is Nothing )
Set rtitem = doc.GetFirstItem( "Body" )
If Not rtitem Is Nothing Then
If ( rtitem.Type = RICHTEXT ) Then
If Not Isempty(rtitem.EmbeddedObjects) Then
Forall o In rtitem.EmbeddedObjects
If ( o.Type = EMBED_ATTACHMENT ) Then
Call o.ExtractFile _
( "\\serveur\partage\repertoire\" +o.Name)
Call o.Remove
Call doc.save(True,True)
End If
End Forall
End If
End If
End If
Set rtitem = Nothing
Set doc = docs.GetNextDocument(doc)
Wend
End If
End If
End If
Exit Sub
erreur:
Msgbox "("+Cstr(Getthreadinfo (1))+" Call by "+Cstr(Getthreadinfo(10))+")"+Chr(10)+"Erreur " + Str(Err) + " : "+Chr(10) + Cstr(Error)+". "+Chr(10)+"Ligne N° "+Cstr(Erl),16," ERREUR !"
Exit Sub
End Sub
-----------------------------------------------------------------------
merci à tous pour votre aide (on ne le dit jamais assez) longue vie à domino area site vraiment utile s'il en est!
peut être poser ce script dans les tips pour les gens comme moi, peu familiers avec le code LS
D@wOOd