|
|
|
|
|
|
|
|
|
|
|
|
|
|
Mick's travel tricks: miscellaneous tools for your traveling needs (continued)
FIELD $ref := @DeleteField;
FIELD $refoptions := @DeleteField;
FIELD orgrepeat := @DeleteField;
FIELD repeatweekend := @DeleteField;
SELECT @All
|
Remove attx.xxx attachments
Many of my emails appear in Notes as text and also have an att1.eml or att1.htm attachment, which is usually the email body in another format: Outlook or HTML. I created an agent that removes all of these attachments but leaves other attachments intact. I run this from my Attachment view that we looked at in my March 2002 article at http://www.dominopower.com/issues/issue200203/travel0302001.html). The code is as follows:
Sub Initialize
Dim sess As New notessession
Dim db As NotesDatabase
Dim docs As NotesDocumentCollection
Dim doc As NotesDocument
Set db = sess.CurrentDatabase
Set docs = db.UnprocessedDocuments
Set doc = docs.GetFirstDocument
Dim attremoved As Variant
count = 0
Do While Not (doc Is Nothing)
count = count + 1
Print count " of " docs.count
attremoved = objdel(doc, "att1.eml")
attremoved = attremoved Or objdel(doc,"att2.eml")
attremoved = attremoved Or objdel(doc,"att3.eml")
attremoved = attremoved Or objdel(doc,"att4.eml")
attremoved = attremoved Or objdel(doc,"att5.eml")
attremoved = attremoved Or objdel(doc,"att6.eml")
attremoved = attremoved Or objdel(doc,"att7.eml")
attremoved = attremoved Or objdel(doc,"att8.eml")
attremoved = attremoved Or objdel(doc,"att9.eml")
attremoved = attremoved Or objdel(doc,"att1.htm")
attremoved = attremoved Or objdel(doc,"att2.htm")
attremoved = attremoved Or objdel(doc,"att3.htm")
attremoved = attremoved Or objdel(doc,"att4.htm")
attremoved = attremoved Or objdel(doc,"att5.htm")
attremoved = attremoved Or objdel(doc,"att6.htm")
attremoved = attremoved Or objdel(doc,"att7.htm")
attremoved = attremoved Or objdel(doc,"att8.htm")
attremoved = attremoved Or objdel(doc,"att9.htm")
attremoved = attremoved Or objdel(doc,"att1.unk")
attremoved = attremoved Or objdel(doc,"att2.unk")
attremoved = attremoved Or objdel(doc,"att3.unk")
attremoved = attremoved Or objdel(doc,"att4.unk")
attremoved = attremoved Or objdel(doc,"att5.unk")
attremoved = attremoved Or objdel(doc,"att6.unk")
attremoved = attremoved Or objdel(doc,"att7.unk")
attremoved = attremoved Or objdel(doc,"att8.unk")
attremoved = attremoved Or objdel(doc,"att9.unk")
If attremoved = True Then Call doc.Save(True, True)
Set doc = docs.GetNextDocument(doc)
Loop
Print "Done"
End Sub
Function objdel(doc As notesdocument, attfilename As String)
Dim object As NotesEmbeddedObject
Dim rtitem As Variant
Set rtitem = doc.GetFirstItem( "Body" )
objdel = False
If ( rtitem.Type = RICHTEXT ) Then
'look for objects...
Set object = rtitem.GetEmbeddedObject(attfilename)
If object Is Nothing Then
Else
Call object.Remove
objdel = True
End If
End If
End Function
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-- Advertisement --
Learn Notes and Domino 8 at your place and pace!
Learn Notes and Domino in your office and/or home! TLCC's highly acclaimed distance learning courses for users, developers, and admins will enhance your career and your resume.
The many included activities and demos will make you a pro! Expert instructor help is a click away.
Click here to try a FREE demo course!! |
-- Advertisement --
Mark your calendar for in-depth Lotus training, May 12-14, Boston
Join experts and peers May 12-14 in Boston for educational and networking events that deliver real-world Lotus training so you can increase productivity and efficiency in your company, advance your skills, and squeeze the most from your current environment. One registration gets you into THE VIEW's Admin2010 and Lotus Developer2010.
Register by April 10 to save $200. |
|
|
|
|
|
|
|
|
|
|