Hab nit augegeben! Bis zu letzt gekämpft!
Aber jetzt hab ich es endlich hinbekommen!
Wenns noch intressiert ..... hier der Code dazu:
Dim s As New NotesSession
Dim db As NotesDatabase
Set db = s.CurrentDatabase
Dim ws As New NotesUIWorkspace
Dim uidoc As NotesUIDocument
Dim fileaufruf As String
Dim rtfield As NotesRichTextItem
Dim doc As NotesDocument
Dim nfo As Variant
Dim docUNID As String
Dim object As NotesEmbeddedObject
Set uidoc = ws.CurrentDocument
Set doc = uidoc.Document
Call uidoc.save()
Call uidoc.close
If Not doc.HasEmbedded Then
Set rtfield = doc.GetFirstItem( "pic" )
If rtfield.Type = RICHTEXT Then
fileaufruf = "Alle Dateien (*.*)|*.*|BMP - Pictures|*.bmp|GIF - Pictures|*.gif|JPEG - Pictures|*.jpg||"
nfo = ws.OpenFileDialog( False , "Hintergrundgrafik" , fileaufruf, "c:\", "" )
If Not Isempty( nfo ) Then
Set rtfield = New NotesRichTextItem( doc,"pic" )
Set object = rtfield.EmbedObject( EMBED_ATTACHMENT, "", nfo(0) )
doc.picname = Object.name
End If ' If Not Isempty( nfo ) Then
End If ' If rtfield.Type = RICHTEXT Then
docUNID = doc.UniversalID
Call doc.Save( True, False, True )
doc.saveoptions = "0"
Call uidoc.close
Set doc = db.GetDocumentByUNID( docUNID )
Set uidoc = ws.Editdocument( True, doc )
Set doc = uidoc.Document
doc.SaveOptions = "1"
End If ' If Not doc.HasEmbedded Then