Agent to remove attachments

0 pts.
Tags:
Microsoft Exchange
I have an agent that runs against a database that removes the attachment from emails in a certain folder. The agent uses object.remove after getting the attachments and it removes them and puts them into a folder on local hard drive which is fine. The problem is that when I go into the email the attachment icon is still there and it's name but when I try to open it, it is gone and says Server Error: This database cannot be read due to an invalid on disk structure. Any ideas? Thanks
ASKED: August 30, 2005  4:55 PM
UPDATED: August 31, 2005  9:39 AM

Answer Wiki

Thanks. We'll let you know when a new response is added.

Here’s a simplified snippet of what we use:

For Each oAttachment In oAttachments
oAttachment.WriteToFile(strParentDir & oAttachment.Name)
Next
oAttachments.Delete
oCurrentMsg.Unread = False oCurrentMsg.Update

Is it possible that you need a object.update to clear the attachment from the message?

Discuss This Question: 2  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • A1234567
    Here's a simplified snippet of what we use: For Each oAttachment In oAttachments oAttachment.WriteToFile(strParentDir & oAttachment.Name) Next oAttachments.Delete oCurrentMsg.Unread = False oCurrentMsg.Update Is it possible that you need a object.update to clear the attachment from the message?
    10 pointsBadges:
    report
  • Bball54
    Thank you for your responses. This is what I have and I'm not sure on what kind of variables you are using for oCurrentMsg and the delete object part. Dim o As NotesEmbeddedObject Set View = Db.GetView("FoldersTest") Set document = View.GetFirstDocument Set collection = view.AllEntries While Not (document Is Nothing) AttName=Evaluate(| @AttachmentNames |, document) Forall attachments In AttName Set o = document.GetAttachment(Attachments) If Not ( oIs Nothing ) Then Call o.ExtractFile("c:" & Attachments) Call o.Remove Call document.Save(True,True) Can I correlate the two or do I need to rewrite my code? Thanks for the help.
    0 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following