Hmm, bei uns ist es so geloest, dass einfach ein neuer "Reply with history" und "Reply to All with history" in die Mailbox Schablone eingebaut wurde. Der Code kam von notes.net und faellt in gewissen Faellen auf die Schna*ze.
Reply with history:
Dim session As New NotesSession
Dim ws As New NotesUIWorkspace
Dim db As NotesDatabase
Dim dc As NotesDocumentCollection
Dim doc As NotesDocument
Dim tempdoc As NotesDocument
Set db = session.currentDatabase
Dim uidoc As NotesUIDocument
Set uidoc = ws.currentdocument
If uidoc Is Nothing Then
Call ws.EditDocument(False)
Set uidoc=ws.currentDocument
End If
Set doc = uidoc.document
' Check if the document has attachments , if not then do a normal reply with history
If doc.HasEmbedded = False Then
Call ws.ComposeDocument("","","Reply With History")
Call uidoc.close
Exit Sub
End If
' Check if the embedded object has atleast one attachment, if no then do a normal reply with history
Dim count As Integer
Dim item As NotesRichTextItem
Set item=doc.getFirstItem("body") ' get body
count = 0
Forall x In item.embeddedObjects
If x.type=1454 Then
count = 1
End If
End Forall
If count = 0 Then
Call ws.ComposeDocument("","","Reply With History")
Call uidoc.close
Exit Sub
End If
'prompt user if the mail has attachments to keep or remove
response= Msgbox("Do you wish to keep the attachments ?",32+4,"This message has file attachments...")
If response="6" Then
Call ws.ComposeDocument("","","Reply With History")
Call uidoc.close
Exit Sub
End If
Set tempdoc = New NotesDocument(db)
Set item=doc.getFirstItem("body") ' get rid of attachments from backgroud document
Forall x In item.embeddedObjects
If x.type=1454 Then
x.remove
End If
End Forall
Call uidoc.close
Call doc.CopyAllItems(tempdoc,True)
Call tempdoc.MakeResponse( doc)
Call tempdoc.Save(True,False)
' open the tempdoc using the new memo form to create a rwh
Set uidoc = ws.EditDocument(True,tempdoc)
Set anotheruidoc = ws.ComposeDocument("","","Reply With History")
Dim refitemintempdoc As NotesItem
Set refitemintempdoc = tempdoc.GetFirstItem("$REF")
Dim refitem As NotesItem
Set refitem = refitemintempdoc.CopyItemToDocument( anotheruidoc.document,"$REF")
Call uidoc.close
Call tempdoc.Remove(True)
Reply to all:
Dim session As New NotesSession
Dim ws As New NotesUIWorkspace
Dim db As NotesDatabase
Dim dc As NotesDocumentCollection
Dim doc As NotesDocument
Dim tempdoc As NotesDocument
Set db = session.currentDatabase
Dim uidoc As NotesUIDocument
Set uidoc = ws.currentdocument
If uidoc Is Nothing Then
Call ws.EditDocument(False)
Set uidoc=ws.currentDocument
End If
Set doc = uidoc.document
' Check if the document has attachments , if not then do a normal reply with history
If doc.HasEmbedded = False Then
Call session.SetEnvironmentVar( "MailStEd", "9" )
Call ws.ComposeDocument("","","Reply With History")
Call uidoc.close
Exit Sub
End If
' Check if the embedded object has atleast one attachment, if no then do a normal reply with history
Dim count As Integer
Dim item As NotesRichTextItem
Set item=doc.getFirstItem("body") ' get body
count = 0
Forall x In item.embeddedObjects
If x.type=1454 Then
count = 1
End If
End Forall
If count = 0 Then
Call session.SetEnvironmentVar( "MailStEd", "9" )
Call ws.ComposeDocument("","","Reply With History")
Call uidoc.close
Exit Sub
End If
'prompt user if the mail has attachments to keep or remove
response= Msgbox("Do you wish to keep the attachments ?",32+4,"This message has file attachments...")
If response="6" Then
Call session.SetEnvironmentVar( "MailStEd", "9" )
Call ws.ComposeDocument("","","Reply With History")
Call uidoc.close
Exit Sub
End If
Set tempdoc = New NotesDocument(db)
Set item=doc.getFirstItem("body") ' get rid of attachments from backgroud document
Forall x In item.embeddedObjects
If x.type=1454 Then
x.remove
End If
End Forall
Call uidoc.close
Call doc.CopyAllItems(tempdoc,True)
Call tempdoc.MakeResponse( doc)
Call tempdoc.Save(True,False)
' open the tempdoc using the new memo form to create a rwh
Set uidoc = ws.EditDocument(True,tempdoc)
Call session.SetEnvironmentVar( "MailStEd", "9" )
Set anotheruidoc = ws.ComposeDocument("","","Reply With History")
Dim refitemintempdoc As NotesItem
Set refitemintempdoc = tempdoc.GetFirstItem("$REF")
Dim refitem As NotesItem
Set refitem = refitemintempdoc.CopyItemToDocument( anotheruidoc.document,"$REF")
Call uidoc.close
Call tempdoc.Remove(True)