Ich denke, Du musst das UI Dokument schließen, die Datei ins das Backend-Dokument anhängen und dieses speichern und dann das UI Dokument wieder öffnen.
Also so:
Sub Click(Source As Button)
Dim s As New NotesSession
Dim ws As New NotesUIWorkspace
Dim uidoc As NotesUIDocument
Dim fileaufruf As String
Dim doc As NotesDocument
Dim nfo As Variant
Dim object As NotesEmbeddedObject
Dim rtitem As Variant
Set db = s.CurrentDatabase
Set uidoc = ws.CurrentDocument
Set doc = uidoc.Document
Call uidoc.Save
Call uidoc.Close
'--------------------------------------------------------------------------------------------------------
Set rtitem = doc.GetFirstItem( "uebergabe_doc" )
If rtitem Is Nothing Then
Set rtitem = New NotesRichTextItem( doc,"uebergabe_doc" )
End If
'--------------------------------------------------------------------------------------------------------
If ( rtitem.Type = RICHTEXT ) Then
o = rtitem.EmbeddedObjects
If Isarray (rtitem.EmbeddedObjects) Then
If ( o(0).Type = EMBED_ATTACHMENT ) Then
Msgbox "handover document allready exist, please press 'remove handover to add a new handover", 0 + 16, "handover document file allready exist"
End If
Else
fileaufruf = "all files (*.*)|*.*|IMS *.pdf files|*.pdf|IMS *.doc files|*.doc|"
nfo = ws.OpenFileDialog( False , "IMS handover document" , fileaufruf, "c:\", "" )
If Not Isempty( nfo ) Then
Set object = rtitem.EmbedObject( EMBED_ATTACHMENT, "", nfo(0) )
Else
Msgbox "no handover document attached", 0 + 64, "no handover attached"
End If
Call doc.Save( True, False, True )
Msgbox "handover document attached successfully", 0 + 64, "handover document attached"
End If
End If
Call ws.EditDocment( True, doc )
End Sub