Domino Code Fragment

Code Name*
Add Rich Text thru the UI no views used in code!
Date*
04/28/2024
Source (or email address if you prefer)*
Rlatulippe@romac.com
IP address:.3.144.202.167
Description*
Refresh the current UI doc when an attachment is added.
Type*
LotusScript
Categories*
(Misc)
Implementation:
Required Client:
Server:
Limitations:
Comments:
Files/Graphics attachments (if applicable): Code:
Sub Click(Source As Button)

Dim w As New notesuiworkspace
Dim s As New NotesSession
Dim db As notesdatabase
Dim uidoc As notesuidocument
Dim object As notesembeddedobject
Dim doc As notesdocument
Dim col As NotesDocumentCollection
Dim DT As New NotesDateTime("1/1/50")
Set db = s.currentdatabase
Set uidoc = w.currentdocument
Dim rtitem As Variant
Set doc = uidoc.Document

'Create New RichTextItem in the current document
Set rtitem = New NotesRichTextItem(doc,"RT")

'Attach the bitmap
Set object = rtitem.EmbedObject ( EMBED_ATTACHMENT, "", "c:\access.txt", "Att" )

'Set the form field and save document through backend
Call doc.save(False,False)

'Set save options to zero so that user does not get prompted to save after closing uidoc
doc.saveoptions = "0"
Call uidoc.close
Call w.editdocument(True, doc)
doc.saveoptions = "1"

End Sub