Forward attachments - doc version

(1)Extracts all attachments from the current uidoc. (2)Create a new doc using the "Memo" form and insert those attachments.
LotusScript


Sub Click(Source As Button)
     
     Dim session As New NotesSession
     Dim workspace As New NotesUIWorkspace
     
     Dim db As NotesDatabase
     Set db = session.CurrentDatabase
     
     Dim uidoc As notesuidocument                      
     Set uidoc = workspace.CurrentDocument         
     Set Doc1 = uidoc.Document                           
     
     Dim Doc2 As NotesDocument    
     Set Doc2 = db.CreateDocument 
     
     Call Doc1.CopyAllItems(Doc2, True)
     
     Forall i In doc2.items
          If i.name="$FILE" Then
          Else
               Call Doc2.RemoveItem(i.name)
          End If
     End Forall
     
     Doc2.Form = "Memo"
      
     '************Open Doc2 as NotesUIDocument****************
     
     Dim ws As New notesuiworkspace
     Dim uidoc2 As notesuidocument
     Set uidoc2 = ws.EditDocument(True, Doc2 ) 
     
End Sub

Posted by fbrefere001 on Wednesday June 6, 2001