Hi,
I am using Lotus Script to add attachments in the Body.
Following is the code snippet for the same:
Dim attachments As Variant
Dim ebdObject As NotesEmbeddedObject
Dim EbdObject As NotesEmbeddedObject
Dim rtitem As NotesRichTextItem
Dim doc As NotesDocument
Dim sFileName As String
Set uidoc = ws.CurrentDocument
Set doc = uidoc.Document
attachments = Evaluate(“@AttachmentNames”, doc)
For i = 0 To Ubound (attachments)
Set ebdObject = doc.GetAttachment(attachments(i))
Call ebdObject.ExtractFile("C:\Files" & attachments(i))
Next
If doc.IsNewNote = True Then
Set rtitem =doc.CreateRichTextItem(“NewRtItem”)
Else
Set rtitem = doc.GetFirstItem(“Body”)
End If
‘Clear the Body
Call uidoc.FieldSetText(“Body”,“”)
For i= 0 To Ubound(attachments)
sFileName = "C:\Files" & attachments(i)
Set EbdObject = rtitem.EmbedObject(EMBED_ATTACHMENT,“”,
sFileName, attachments(i))
Kill sFileName
Next
Call doc.Save(True,False)
This code is attaching files to the NotesRichTextItem but doesn’t display the attachments immediately after the document is saved.
Attachments are displayed to the user only after saving and reopening the meeting.
How can I modify the code, so that I can view the attachments immediately after the document is saved?
Thanks,
Vishvanath