NotesRichTextItem.saveToDisk=False do not work

On PostOpen Event I create RichtextItem and set property SaveToDisk=false.But as I save the documment - the item is saved with the document.

I tried creating item through New NotesItem and through CopuItem from another document.

I don’t have this fields anywhere in the form (I do not need them for user UI - i need them for other purposes.).

Any idea what to do?

If the item is not richtext item it all works fine, but i need it to be richtextitem.

10x in advance to all of you.

Subject: NotesRichTextItem.saveToDisk=False do not work

The help states - If you mark an existing item as not to be saved, it disappears from disk the next time you save the document.

As rich text fields do not exist on the document until it is saved for the first time then this is probably the problem. Have you tried it on an existing document to see if the rich text field disappears?

Subject: RE: NotesRichTextItem.saveToDisk=False do not work

In read mode all is OK - I use them to calculate some items. But if I save document - the items are saved to.They don’t disappear after save.

Subject: RE: NotesRichTextItem.saveToDisk=False do not work

What are you doing in read mode? If it is creating a rich text field on the back end document but you never save that document then the rich text field will not be saved to disk.

There is a difference in the way rich text fields and other fields work.

text, number fields etc exist on a document as soon as it is created so setting SaveToDisk to False will not save them to a document.

rich text fields do not exist on a document until it has been saved for the first time so setting SaveToDisk to False is having no affect. It can not see the rich text field to stop it being saved.

Subject: RE: NotesRichTextItem.saveToDisk=False do not work

I have tested this out and found that SaveToDisk = False does not work for new rich text fields or rich text fields where you set SaveToDisk = False but amend the value of the existing field

'New Document. Rich Text field saved with value of TEXT

Sub Postopen(Source As Notesuidocument)

Dim ws As New notesuiworkspace

Dim uidoc As NotesuiDocument

Dim doc As notesdocument

Dim rtitem As notesrichtextitem



Set uidoc = ws.CurrentDocument

Set doc = uidoc.Document

Set rtitem = New notesrichtextitem(doc, "TestRTFIeld")

Call rtitem.AppendText("TEXT")

rtitem.SaveToDisk = False

End Sub

'Existing rich text field with value of TEXT not saved to the document

Sub Postopen(Source As Notesuidocument)

Dim ws As New notesuiworkspace

Dim uidoc As NotesuiDocument

Dim doc As notesdocument

Dim rtitem As notesrichtextitem



Set uidoc = ws.CurrentDocument

Set doc = uidoc.Document



Set rtitem = doc.GetFirstItem("TestRTField")

rtitem.SaveToDisk = False

End Sub

'Existing rich text field with value of TEXT saved to document with new value of TEXT1

Sub Postopen(Source As Notesuidocument)

Dim ws As New notesuiworkspace

Dim uidoc As NotesuiDocument

Dim doc As notesdocument

Dim rtitem As notesrichtextitem



Set uidoc = ws.CurrentDocument

Set doc = uidoc.Document

Set rtitem = doc.GetFirstItem("TestRTField")

Call rtitem.AppendText("TEXT1")

rtitem.SaveToDisk = False

End Sub

Subject: RE: NotesRichTextItem.saveToDisk=False do not work

Thanks a lot Matt.Because the names of that fields are calculated dynamically I have decided to dim a global variable of all the fields I create on post open event, and on QueryClose to delete them with doc.GetFirstItem and item.remove rather to cycle with forall item in doc.Items and if … item.remove.

Once again. 10x a lot.