Domino 9 und frühere Versionen > Entwicklung
Reply with History without Attachement
(1/1)
kloeti:
Hi ihr Scriptmeisters
Also, unsere Looser sind so schlau und schicken 3MB von A nach B. B schickt ein Reply nach A und A antwortet wieder nach B und kopiert noch C, weil's Spass macht. Jedesmal werden die 3MB natürlich mit gejagt ::)
Hat einer ein Tip für mich, wie wo welches Script ich da einpflanzen kann ? Ihr habt sicher was im Strickkästchen für mich breit ;)
Gruzz
kloeti
Silke:
Ich (superDAU) :-/ habe mal gehört dass man am Server attachments abbremsen kann.
Wer weiss vielleicht hilft das?!
grosses.manitu:
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:
--- Code: ---
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)
--- Ende Code ---
Reply to all:
--- Code: ---
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)
--- Ende Code ---
luna:
hallo,
ich denke mal, aus dem button, wo die ganzen replies drin sind, die beiden mit history einfach rausnehmen, ist keine gute loesung, oder?
ich denke nur, man koennte doch das da wegnehmen, damit der user das nicht einfach mal so schnell nimmt, und lieber dafuer im menu (damit es schwerer zu finden ist) was einbauen? weil der user sollte ja schon waehlen koennen, oder? wenn nicht, kann mans ja einfach ersatzlos rausnehmen. gleich aus der schablone, in den shared actions.
gruss,
daniela
grosses.manitu:
???
Aehm, das oben gepostete Script fragt eigentlich, wenn ein Attachment vorhanden ist, ob es entfernt werden soll oder nicht....
Navigation
[0] Themen-Index
Zur normalen Ansicht wechseln