Home > Domino Tips > Administrator > E-mail > Remove attachment(s) from reply with history
Domino Tips:
EMAIL THIS
 TIPS & NEWSLETTERS TOPICS 

E-MAIL

Remove attachment(s) from reply with history


Henrik Toftegaard
07.29.2002
Rating: -4.19- (out of 5)


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   


You Can View User Feedback To This Tip

You only need to modify the "Reply" and the "Reply With History" forms. They way we've done it is simple, and it works. Try it out.

Here's the code for the "Reply With History" form, put it in the "Postopen" event (below the: "Call cMemoObject.PostOpen(Source)"

code):

Code

Dim session As New NotesSession
Dim db As NotesDatabase
Set db = session.CurrentDatabase
               
Dim doc As NotesDocument
Dim id As String
id = session.GetEnvironmentString("DeleteAttachment")
              
If id <> "" Then
              On Error Goto finish 
Set doc = db.GetDocumentByUNID(id)
              If Not doc Is Nothing Then 
               Call doc.Remove(True)
              End If
Call session.SetEnvironmentVar("DeleteAttachment", "")
              End If
              
finish:
              
'Remove attachments - if any
Set doc = Source.Document
If doc.HasEmbedded = True Then
              response= Msgbox("Shall I remove attachments from your answer?",
32+4, "Reply with attachments")
              If response = 7 Then
              'Mail with attachments
              Exit Sub
              End If
              Else
              'No attachments
              Exit Sub
              End If
              
'Here we remove attachments
Call Source.Save
              
Dim item As NotesRichTextItem
Set item = doc.getFirstItem("Body")
Forall o In item.EmbeddedObjects
              If (o.Type = EMBED_ATTACHMENT) Then
'And write the name on the removed files
Call item.Appendtext("<< Attachment removed : " + o.Source + " >>")
Call item.AddNewLine(1)
Call o.Remove
Call doc.Save(1,0,1)
End If
End Forall
              
Call Source.Close
              
Dim workspace As New NotesUIWorkspace
Dim uidoc As NotesUIDocument
Set uidoc = workspace.EditDocument(True, doc)
              
Call session.SetEnvironmentVar("DeleteAttachment", doc.UniversalID, False)

We use the "Reply" form for the respons without attachment, here's the code for the "Postopen" event in that form:

'Remove doc's that have been saved earlier
Dim session As New NotesSession
Dim db As NotesDatabase
Set db = session.CurrentDatabase
              
Dim doc As NotesDocument
Dim id As String
id = session.GetEnvironmentString("DeleteAttachment")
              
If id <> "" Then
              On Error Goto finish
Set doc = db.GetDocumentByUNID(id)
              If Not doc Is Nothing Then
              Call doc.Remove(True)
              End If
Call session.SetEnvironmentVar("DeleteAttachment", "")
              End If
               
               Exit Sub
finish:
              Exit Sub
End Sub

USER FEEDBACK TO THIS TIP

  • It works, however it shows an error after you say yes to the prompt if you want to remove attachments. The error occurs when you execute the Call Source.Save line, inside the Private Function SetOptionField(Itemname As String, nFlag As Integer) it stops with 'Object variable not set' error message on the following line: Case ITEM_REMOVE — Jacek Sompel


Rate this Tip
To rate tips, you must be a member of SearchDomino.com.
Register now to start rating these tips. Log in if you are already a member.


Submit a Tip




Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   



RELATED CONTENT
E-mail
Secure Lotus Notes/Domino 8.x from mail to unknown recipients
Domino server setting and email policy tricks admins must know
Top 10 Lotus Notes/Domino administration tips of 2008
Can Lotus Notes/Domino and Microsoft SharePoint play nice together?
Using Formula language code to sort Lotus Notes messages by subject
LotusScript action button manages Lotus Notes mail files
Exploring Lotus Notes Domino 8.0.1 and beyond
LotusScript agent moves tagged spam email to junk mail folder
Send SMS text messages between Lotus Notes 7 and mobile devices
Update to Exchange Server 2003 Connector for Lotus Notes

RELATED RESOURCES
2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
Search Bitpipe.com for the latest white papers and business webcasts
Whatis.com, the online computer dictionary

DISCLAIMER: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.



Domino & Lotus Notes Security Solutions: Authentication, Antispam, Encryption and Antivirus
HomeTopicsITKnowledge ExchangeTipsAsk the ExpertsMultimediaWhite PapersDomino IT Downloads
About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
SEARCH 
TechTarget provides technology professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective purchase decisions and managing their organizations' technology projects - with its network of technology-specific websites, events and online magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Site Map




All Rights Reserved, Copyright 1999 - 2009, TechTarget | Read our Privacy Policy
  TechTarget - The IT Media ROI Experts