Get Rid Of Annoying Avi, Bitmap, Etc Attachments

Tired of mail files growing too large because of big avi, bmp, exe, etc
attachments? Create an agent using this script and clear out the offending
attachments.
Sub Initialize
Dim session As New NotesSession
Dim db As NotesDatabase
Dim view As NotesView
Dim doc As NotesDocument
Dim rtitem As Variant
Dim SourceName As String
Dim Extension As Variant

Set db = session.CurrentDatabase
Set view = db.GetView("All")
Set doc = view.GetFirstDocument

Do While Not(doc Is Nothing)

If doc.HasEmbedded Then
Set rtitem = doc.GetFirstItem("Body")

If(rtitem.Type = RICHTEXT) Then
Forall o In rtitem.EmbeddedObjects
If(o.Type = EMBED_ATTACHMENT) Then
SourceName = o.Source
Extension =
Evaluate("@Contains(SourceName;"".avi"":"".bmp"")")
If extension(0) = 0 Then
Call o.Remove
Call doc.Save( False, True )
End If
End If
End Forall
End If
End If

Set doc=view.GetNextDocument(doc)

Loop
End Sub

Dig Deeper on Domino Resources

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.

-ADS BY GOOGLE

SearchWindowsServer

Search400

  • iSeries tutorials

    Search400.com'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 ...

SearchDataCenter

SearchContentManagement

Close