How to delete attachments in WMemo agent?

Hi, I am trying to do some customization for Domino Webmail. Particularly I am trying to delete the attachments before the email is sent. I put the following code in wMemo agent but I get Type Mismatch error. Any idea?

Thanks.

If note.HasEmbedded Then

If ( rtiWeb.Type = RICHTEXT ) Then

  Forall object In rtiWeb.EmbeddedObjects 'gives error

      If ( object.Type = EMBED_ATTACHMENT ) Then

Call object.Remove

    End If

  End Forall

End If

End If

Subject: How to delete attachments in WMemo agent?

Check whether you are setting the rtiWeb object?

Subject: RE: How to delete attachments in WMemo agent?

Yes, I do. I found that rtiWeb.EmbeddedObjects is empty even though there are attachments in the messages. Is there any other way to access the attachment that is being sent through WebMail?Thanks.