Domino 9 und frühere Versionen > ND8: Entwicklung

NotesRichTextItem

<< < (2/4) > >>

eknori:
Mit CopyItemToDocument kommst du bei RTI nicht weiter. Die musst du anders kopieren, damit auch die $FileItems mit in das ZielDokument übernommen werden.

Hier ein Beispiel

Dim rtBodyMemo As Variant
Dim rtBodyTarget As Variant

If memo.HasItem("Body") Then ' existiert das BODY Item?
Set item = memo.Getfirstitem("Body") ' BODY Feld holen
If item.type = RICHTEXT Then ' Ist das Item ein RICHTEXT Item ?
Set rtBodyMemo = memo.GetFirstItem("Body")
Set rtBodyTarget = New NotesRichTextItem ( target, "Body" )
Call rtBodyTarget.AppendRTItem( rtBodyMemo )
End If

pram:
Ein "Call rtBodyTarget.compact()" ganz zum Schluss sollte man auch noch machen... und man sollte die "session.convertMime"-Einstellung prüfen/ändern, sonst bekommt man nämlich bei Mails ein MIME-Item (und die sind noch blöder zu konvertieren)

@Ulrich, bist du dir da sicher? Bei mir hat ein NotesDocument.copyItem(rtItem) die $File-Items automatisch mitgezogen (zumindest in Notes 8.5)
ansonsten ist die Methode von dir wohl die saubere.


--- Zitat ---In einigen eMails sind manchmal Bilder drin die zu Problemen führen, wenn diese in mein Dokument kopiert wurden. Beim Versuch im Frontend zu speichern, kriege ich immer ein "Bitmap kann nicht gespeichert werden"

--- Ende Zitat ---
Ich kenne solche Mails, das ist meist der Fall, wenn externe Bilder eingebunden sind, welche nicht geladen werden können. Ich denke mal, dass da auch in der Originalmail an der Stelle des Bildes ein rotes [X] ist. Da hilft es dann auch nicht, die (gar nicht vorhandenen) $File-Items zu kopieren

Gruß
Roland

Peter Klett:
Sitze gerade an dem gleichen Problem. Mit 8.5.1 FP3 tritt es auf, obwohl es mit FP2 angeblich gefixt sein sollte. Geht das nur mir so?

pram:
Befindet sich das Body-Feld in der Maske oder in der Teilmaske (ja das macht einen großen Unterschied)
https://www-304.ibm.com/support/docview.wss?uid=swg1LO56237

/edit: dies sollte zwar eigentlich schon gefixed sein, aber ich habe mal folgenden PMR an IBM gesendet, ebenfalls in Zusammenhang mit Body-Feld in einer Teilmaske (APAR LO53959, vielleicht interessierts wem)

--- Zitat ---Fehlerbeschreibung                                                      
One of our application that we use daily crashes when deleting attachment.                                                            
The application contains a Form with a computed subform.                
The subform contains a richtext field editable by the user.            
If a user copies a mail into the richtext field (with client 8.5) it sometimes happens that the client crashes when deleting the attachment by selecting it with the mouse-cursor and hitting the DEL-Key.          
 (I've stripped down the problem and generated a very small testdatabase)                                                          
It crashes only on attachments when                                    
- The Hotspot Begin Type is 10 in Notespeek (i've attached a screenshot in the DB that you see what I mean. These Items behave different than other attachments: When deleting Attachments of this type the Text: [attachment ... deleted by ...] is inserted. This is not done with normal items)
- the body field must be in a subform                                  
- The Formula for the computed subform computes to a name that is longer than 34 characters                                              
- you use the DEL key (deleting with right click sometimes works)      
- you use Notes 8.5.1 (I've attached 2 NSD-logs, one Notes 8.5.1, one Notes 8.5.1FP4, both crashes)                                          
With "Release 8.5.2, Revision 20100521.0100 (Build V852_05192010) , Standard Configuration" it is NOT reproduceable, but here not always the text  [attachment ... deleted by ...] is inserted.                  
8.5.1FP3 on the mac seems also not affected
--- Ende Zitat ---

Peter Klett:
Hallo Roland,

danke für die Info.

Ja, es befindet sich in einer Teilmaske (muss auch da bleiben) und ist nicht bearbeitbar. Ausgangssituation ist die gleiche, wie zu Anfang von Lloyd beschrieben, die Anhänge befinden sich nicht im Ursprungsitem, es können also auch keine $Files kopiert werden, weil sie dort schon fehlen (sch... Disclaimer).

Werde da wohl erst einmal was "drumherum" bauen müssen (z.B. bearbeitbar, damit man manuell den Schrott entfernen kann - gefällt mir überhaupt nicht :().

EDIT: Das Feld war grundsätzlich bearbeitbar, aber mittels zugriffsgesteuertem Abschnitt für niemanden. Das nur der Vollständigkeit halber

Navigation

[0] Themen-Index

[#] Nächste Seite

[*] Vorherige Sete

Zur normalen Ansicht wechseln