Das Notes Forum

Domino 9 und frühere Versionen => ND7: Entwicklung => Thema gestartet von: Christopher am 12.03.09 - 09:48:26

Titel: Richtext Felder kopieren!
Beitrag von: Christopher am 12.03.09 - 09:48:26
Hallo Entwickler,

ich will im UI von einem gewählten Dokument das Body Feld in ein geöffnetes Dokument kopieren.
Im Backend funktioniert es ohne Probleme nur der Nutzer muss das Dokument neu öffnen.

Kann ich sowas mit Script auch im UI realisieren?
So das direkt das eingefügte Body Feld sichtbar ist.

Dim session As New NotesSession
   Dim workspace As New NotesUIWorkspace
   Dim uidoc As NotesUIDocument
   Dim doc As NotesDocument,emaildoc As NotesDocument
   Dim db As NotesDatabase       
   Dim rtitemA As Variant
   Dim rtitemB As Variant
   
   Set db = session.currentdatabase
   Set uidoc = workspace.currentDocument
   Set doc = uidoc.Document
   doc.AutoReload = True
   
   ProfDB="mail\mail.nsf"
   ProfServer="server"
   OrgView="($All)"
   
   Set Auswahl=workspace.PickListcollection(PICKLIST_CUSTOM,True,ProfServer,ProfDB,OrgView,"Auswahl RAG","Wählen Sie eine Dokument aus")   
   If Auswahl.count = 0 Then
      Exit Sub
   End If
   
   Set emaildoc=auswahl.getfirstdocument
   Call uidoc.Save
   Set rtitemA = doc.GetFirstItem( "Body_bea" )
   Set rtitemB = emaildoc.GetFirstItem( "Body" )
   
   If ( rtitemA.Type = RICHTEXT And _
   rtitemB.Type = RICHTEXT ) Then
      
      
      Call rtitemA.AddNewLine(1)
      Call rtitemA.AppendRTItem( rtitemB )
      Call uidoc.FieldAppendText _
      ( "Body_bea",  rtitemB  )
      
      Call doc.Save(False, True)
      Call uidoc.Close
   End If
Titel: Re: Richtext Felder kopieren!
Beitrag von: Driri am 12.03.09 - 11:17:33
Ich würde das im Backend machen und dann ein ReOpen auf das Dokument. Anton Tauscher (ata) hat dazu mal eine Funktion geschrieben, die solltest Du hier im Forum finden.