sarah wood 19.Jul.12 08:13 AM a Web browser Domino DesignerAll ReleasesAll Platforms
Hi,
I have an agent that detaches any attachments on an email, and stores them in a folder on my C drive.
I am experiencing a few problems with the agent:
I am currently only able to run it manually from my client, whilst in my inbox from the Actions tool bar. I want this to run on schedule.
The agent fails on new mail which means I have to mark the email as read before running the email. Since I want this agent to run on schedule, I would like it to run on unread emails.
Here is my code as it is today:
Sub Initialize
Dim session As New NotesSession
Dim db As NotesDatabase
Dim doc As NotesDocument
Dim dc As NotesDocumentCollection
Dim rtitem As Variant
Dim attachname As String
Dim filename As String
Dim body As NotesRichTextItem
Dim emphasize As NotesRichTextStyle
Set db = session.CurrentDatabase
Set dc = db.UnprocessedDocuments
Set doc = dc.Getfirstdocument
doc.markRead
Set rtitem = doc.GetFirstItem( "Body" )
If ( rtitem.Type = RICHTEXT ) Then
ForAll obj In rtitem.EmbeddedObjects
If ( obj.Type = EMBED_ATTACHMENT ) Then
attachname = obj.source
Call obj.ExtractFile("C:\....\" & attachname)