hcl-bot
1
Hi!
A database I’m making is suppose to receive emails with 3 attachments that are of the type “.CSV”, “.BBB” and “*.???”.
-
The .CSV file is a CSV-file with data intended for several fields.
-
The .BBB file is a text file where all the text in the file is intended for one field.
-
The .??? file can be anything (PPT, JPG, XLS, BMP etc.) and is intended to be copied (as an attachment) to a richtextfield.
I want to make an agent that creates a new document and automatically processes the 3 attachments into the new document as described above.
Is this even remotely possible?
My lotusscript is not very good so any help or pointing in the right direction is highly appreciated.
Regards
Frank
hcl-bot
2
Subject: Processing attachments with lotusscript agent
It certainly is possible, and not very complicated. Use these pieces of code and let Help help you.
- define the field that will contain the attachements as RichText
If ( rtitem.Type = RICHTEXT ) Then
- loop through all the attachments
Forall o In rtitem.EmbeddedObjects
If ( o.Type = EMBED_ATTACHMENT ) Then
- get the name of the attachment
name=Lcase(o.name)
- look at the last 3 characters to see what yupe
if right$(name,3)=“CSV” then - do this
Call o.ExtractFile ( location_of_file )
do something
elseif right$(name,3)=“BBB” then - do this
Call o.ExtractFile ( location_of_file )
do something else
else
copy the object into the new document
End if
hcl-bot
3
Subject: RE: Processing attachments with lotusscript agent
Hi Rampisad and thank you!
I finally managed to get an agent to do what I wanted. Thanks once again!
Regards
Frank