danke erstmal für Deinen Tip, aber jetzt fliege ich bei deinem vergleich mit object variable not set raus! könnte dran liegen, das der debugger an dieser stelle anzeigt, das beide variablen notesitems vom typ variant sind, obwohl das eigentlich rt-felder sind, oder?
habe mal den ganzen code drangehängt! nicht aufregen, ist nicht so ganz sauber, aber funktioniert bis auf diesen mist...
Sub Initialize
Dim uidoc1 As notesuidocument
Dim backdoc As notesdocument
Dim ss As New NotesSession
Dim ws As New NotesUIWorkspace
Dim db As NotesDatabase
Dim doc As NotesDocument
Dim clipdb As NotesDatabase
Dim clipdc As NotesDocumentCollection
Dim clipdoc As NotesDocument
Dim mainDoc As NotesDocument
Dim mainDocID As String
Dim dboxtitle As String
Dim ok As Integer
Dim authorx() As String
Dim n As Long
Dim m As Long
Dim filePath As String
Const CLIPNAME = "\~clipbrd.ncf"
Set doc = ss.DocumentContext
Dim clipsupplink As notesitem
Dim rtitemA As Variant
Dim rtitemB As Variant
'Zwischenablage öffnen
filepath = ss.GetEnvironmentString( "Directory", True ) & CLIPNAME
Set clipdb = ss.GetDatabase( "", filepath )
If clipdb Is Nothing Then
Messagebox "Kein Dokument in Zwischenablage"
Exit Sub
End If
If Not clipdb.IsOpen Then
Messagebox "Kein Dokument in Zwischenablage"
Exit Sub
End If
Set clipdc = clipdb.AllDocuments
If clipdc.count = 0 Then
Messagebox "Kein Dokument in Zwischenablage"
Exit Sub
End If
Set db = ss.CurrentDatabase
Set clipdoc = clipdc.GetFirstDocument
' Set clipsupplink = clipdoc.GetFirstItem( "Link" )
Set rtitemA = clipdoc.GetFirstItem("Link")
'Variablen zum Schlüssel auslesen
Dim session As New NotesSession
Dim rtitem As notesrichtextitem
Dim item As notesitem
Dim db2 As NotesDatabase
Dim workspace As New NotesUIWorkspace
Dim uidoc As notesuidocument
Dim aktivuidoc As notesuidocument
Dim cpdoc As NotesDocument
Dim aufuposi As String
Dim uiview As NotesUIView
Dim aktivdocid As String
Dim kunde As String
Dim activdoc As notesdocument
Dim collection As notesdocumentcollection
Dim currentaktivuidoc As notesdocument
Dim currentdoc As notesdocument
Dim problem As String
Dim titel As String
Dim aktivdoc As notesdocument
Dim aunr As String
Dim posi As String
Dim temp As Variant
Dim adoc As Variant
Set db2 = session.CurrentDatabase
Set uiview = workspace.Currentview
Set collection = db2.UnprocessedDocuments
Set cpdoc = collection.GetFirstDocument()
Call uiview.SelectDocument(cpdoc) ' Soll das aktuell ausgewählte Dokument in den Zugriff nehmen
Set aktivuidoc = workspace.ComposeDocument("OCS02/OCS GmbH","aktiv\fridaakt.nsf","aktion")
Call aktivuidoc.fieldsettext("Zeitvon", "00:00")
Call aktivuidoc.fieldsettext("zeitbis","00:00")
Call aktivuidoc.fieldsettext("dauer","0")
Call aktivuidoc.fieldsettext("TKT", "055")
Call aktivuidoc.fieldsettext("JNF", "N")
Set backdoc=aktivuidoc.Document
Call backdoc.save(True,True)
Set rtitemb = backdoc.GetFirstItem("Link")
Call aktivuidoc.save
Dim id As String
If ( rtitemA.Type = RICHTEXT And _
rtitemB.Type = RICHTEXT ) Then
Call rtitemb.AppendRTItem( rtitema )
Call rtitema.Remove
Call backdoc.Save( False, True )
Call clipdoc.Save( False, True )
'aktivdocid = aktivuidoc.Document.universalid
Call aktivuidoc.refresh
Call aktivuidoc.save
End If
End Sub