Estrarre un allegato da un Documento Notes

Lo scrivo qui, così rimane nel tempo, e nel tempo, e nel tempo…

Dim nome As String
Dim word As NotesEmbeddedObject
Dim rtitem As NotesRichTextItem
Dim docAllegato As NotesDocument
Dim viewAllegati As NotesViewSet viewAllegati = database.GetView("(Allegati)")
Set docAllegato = viewAllegati.GetDocumentByKey(chiave)
Set rtitem = docAllegato.getfirstitem("body")
Set word = rtitem.GetEmbeddedObject(nome)
If word Is Nothing Then
nome = rtitem.EmbeddedObjects(0).name
Set word = rtitem.GetEmbeddedObject(nome)
End If
Call word.ExtractFile( percorsoTemp$ & docPostaUscita.Oggetto(0) & ".doc")

Nella fattispecie stiamo parlando di un documento Word. Se non viene trovato allegato un file di nome “nome” allora viene preso il primo disponibile (rtitem.EmbeddedObjects(0))

Leave a Reply

Your email address will not be published.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>