Encrypt object in mail

Hello,

I have searched the foums for this without luck so hopefully someone can help me out here.

I am trying to encypt a mail document which contains an object (a .csv file). My issue is that simple text in the email does get encrypted but the object does not. Here is the relevant code

Dim session As New NotesSession

Dim db As NotesDatabase

Dim recipients(0 To 1) As String

Dim mdoc As NotesDocument

Set db = session.currentDatabase

Set mdoc = db.CreateDocument

recipients(0) = “Asad Zubair”

mdoc.form = “Memo”

mdoc.Principal=“test”

mdoc.subject = “Some title”

Set rtitem = New NotesRichTextItem(mdoc,“Body”)

Call rtitem.AppendText(“Simple text which does get encrypted”)

'This object below does not get encrypted

Call rtitem.EmbedObject(1454, “”, “C:\file.csv”)

Dim Encryptitem As New Notesitem(mdoc,“Encrypt”,“1”)

Call mdoc.Send(False,Recipients )

How can I get the csv file to be encrypted as well ??

Thanks,

Subject: encrypt object in mail

Well looks like i answered my own question. I never tried opening the csv file. I just saw that it appeared in the email and thought it was not encrypted. Well, when I tried to open it, I did get a message saying that I cannot do so since it is encrypted.So bottom line, the code did encrypt the object after all.

Sorry for the inconvenience.