Vielen Dank das funktioniert.
Mein Coding sieht nun so aus:
Sub Initialize
Dim session As New NotesSession
Dim db As NotesDatabase
Dim doc As NotesDocument
Dim rtitem As NotesRichtextItem
Dim object As NotesEmbeddedObject
Set db = session.CurrentDatabase
Set doc = session.DocumentContext
Print doc.wfAlias(0)
txtFile$=session.GetEnvironmentString ("AnhangNT")
Set rtitem = New NotesRichTextItem( doc, "txtAnhang" )
'Set rtitem = doc.GetFirstItem( "txtAnhang" )
Set object = rtitem.EmbedObject(EMBED_OBJECT, "", txtFile$)
Call doc.Save( True, True )
End Sub
Alles anzeigen
Es gibt nun noch folgendes Problem:
Der Anhang wird nicht erstellt (nicht angezeigt), das RichtextItem steht direkt neben der Schaltfläche, ist aber auch schon vorhanden.