Domino 9 und frühere Versionen > Entwicklung

inhalt eines rt-feldes (DokLink) aus dem backend holen

<< < (2/3) > >>

OCS:

--- Zitat von: Rob Green am 06.11.03 - 13:31:21 ---Entweder das ganze RT Feld irgendwo andershin kopieren
--- Ende Zitat ---

wie kann ich das ganze feld woanders hinkopieren?

Rob Green:
notes help:

This script takes the Body item on document B and appends it to the end of the Body item on document A. The Body item on document B is deleted using the Remove method defined in NotesItem.
Dim docA As NotesDocument
Dim docB As NotesDocument
Dim rtitemA As Variant
Dim rtitemB As Variant
'...set values of docA and docB...
Set rtitemA = docA.GetFirstItem( "Body" )
Set rtitemB = docB.GetFirstItem( "Body" )
If ( rtitemA.Type = RICHTEXT And _
rtitemB.Type = RICHTEXT ) Then
  Call rtitemA.AppendRTItem( rtitemB )
  Call rtitemB.Remove
  Call docA.Save( False, True )
  Call docB.Save( False, True )
End If


oder


This script copies the Body and BriefDescription items from a document to a new mail memo in the current database. The Body item keeps its name; the BriefDescription item is renamed Subject.
Dim session As New NotesSession
Dim db As NotesDatabase
Dim doc As NotesDocument
Dim memo As NotesDocument
Dim itemA As NotesItem
Dim itemB As NotesItem
Set db = session.CurrentDatabase
'...set value of doc...
Set itemA = doc.GetFirstItem( "Body" )
Set itemB = doc.GetFirstItem( "BriefDescription" )
Set memo = New NotesDocument( db )
Call itemA.CopyItemToDocument( memo, "" )
Call itemB.CopyItemToDocument( memo, "Subject" )
Call memo.Send( False, "Cynthia Brainey" )

OCS:
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...  ;D


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

Rob Green:
an welcher genau kommt die Fehlermeldung?

OCS:
zeile 11 von unten  :-[

Navigation

[0] Themen-Index

[#] Nächste Seite

[*] Vorherige Sete

Zur normalen Ansicht wechseln