Modify message body with attachment

Hi,I am having a problem while modifying a mail message. I am adding an attachment in the existing mail body and trying to get it’s details. I am writing this code in PostSave event. I am getting the value of Body but I am not able to get details of the attachment.

I am using HasEmbedded to check for an attachment but this is where I am getting false as return. So my question is

  1. When we modify mail body and add an attachment where is the attachment saved?(In Body field or any other field)

If anyone has problem like this or knows any solution , please reply.

Thanking in advance.

Mandar

Subject: Modify message body with attachment

Hi Mandar,

Try using the NotesRichtextItem embedded object property.

Subject: Modify message body with attachment

Hi,Can you please explain more. I am attaching here my code for your reference.Please tell me if anything else to check.

IF (S43251664_MgDocument.HasEmbedded) then

Set S43251664_MgRTitem = S43251664_MgDocument.GetFirstItem(“Body”)

If(S43251664_MgRTitem.Type=RICHTEXT) Then

Forall j in S43251664_MgRTitem.EmbeddedObjects

if(j.Type=EMBED_ATTACHMENT) then

S43251664_MgCnt = S43251664_MgCnt + 1

S43251664_AttachmentName = S43251664_MgUniversalID &““& Trim(Str(S43251664_MgCnt)) &””& j.Name()

Call j.ExtractFile(S43251664_MgFilePath & S43251664_AttachmentName)

S43251664_Mgxml=S43251664_Mgxml + {}+Chr(13)

S43251664_Mgxml=S43251664_Mgxml + “”+Trim(Str(S43251664_MgCnt))+“” +Chr(13)

S43251664_Mgxml=S43251664_Mgxml + “”+j.Name()+“” + Chr(13)

S43251664_Mgxml=S43251664_Mgxml + “”+S43251664_MgFilePath & S43251664_AttachmentName+“”+Chr(13)

S43251664_Mgxml=S43251664_Mgxml + {}

j.Remove

End If

End Forall

End If

End If