Manage Learn to apply best practices and optimize your operations.

Detach all attached files in selected documents

Detach all attached files in selected documents

Here is a very useful LotusScript view action that will detach all the attached files of selected documents in a view to a designated folder in the user's hard drive. The function can be made even more useful by retrieving the path name from a profile document, an environment variable or a user prompt.

Sub Click(Source As Button)
     Dim session As New NotesSession
     Dim db As NotesDatabase
     Dim collection As NotesDocumentCollection
     Dim doc As NotesDocument
     Dim rtitem As NotesRichTextItem
     Set db = session.CurrentDatabase
'    The path name can be retrieved from a profile document,
environment variable or a user prompt. ' PathName$ = "C:/TDD/" ' ' Set collection to all selected documents Set collection = db.UnprocessedDocuments ' ' Process each selected document ' For i = 1 To collection.Count Set doc = collection.GetNthdocument(i) Set rtitem = doc.GetFirstItem( "Body" ) If (rtitem.Type = RICHTEXT ) Then ' ' Detach all attachments in the document ' Forall o In rtItem.EmbeddedObjects Fname$=o.Name Call o.ExtractFile(PathName$&Fname$) End Forall End If Next Messagebox("Files detached to "&PathName$) End Sub

Dig Deeper on LotusScript



  • iSeries tutorials's tutorials provide in-depth information on the iSeries. Our iSeries tutorials address areas you need to know about...

  • V6R1 upgrade planning checklist

    When upgrading to V6R1, make sure your software will be supported, your programs will function and the correct PTFs have been ...

  • Connecting multiple iSeries systems through DDM

    Working with databases over multiple iSeries systems can be simple when remotely connecting logical partitions with distributed ...