I am trying to attach a file to a notes document using an action hotspot.
My code is working, with the exception that my file is not be attached in my richtext field, but rather at the bottom of the document.
I read the following thread of a person having the same issue, and Andre responding linking to a thread about refreshing the uidoc w/out saving it…
The author of the thread said he would try the solution, but never responded if it worked…
As it isn’t working for me.
Here is my code:
Sub Click(Source As Button)
Dim session As New NotesSession
Dim db As NotesDatabase
Dim workspace As New NotesUIWorkspace
Dim uiDoc As NotesuiDocument
Dim uiDocNew As NotesUiDocument
Dim doc As NotesDocument
Dim filenames As Variant
Dim rtitem As NotesRichTextItem
Dim object As NotesEmbeddedObject
Set db = session.CurrentDatabase
Set uiDoc = workspace.CurrentDocument
Set doc = uiDoc.Document
filenames = workSpace.OpenFileDialog(True, "Select files LOE documents.")
If Not(Isempty(filenames)) Then
Set rtitem = doc.GetFirstItem("LOEAttachment")
Forall filename In filenames
Set object = rtitem.EmbedObject( EMBED_ATTACHMENT, "", filename)
End Forall
End If
Call updateHistory(session, doc," attached LOE documents. ", "")
doc.SaveOptions = "0"
Call uidoc.Close(True)
Set uidocNew = workspace.EditDocument(True, doc, , , , True)
Set uidoc = workspace.currentdocument
End Sub
Has anyone been successful attaching a file in a richtext field using LotusScript?
Many thanks for any help.