Question

I can get the size of the attachments using @Attachmentlength(), or Using NotesEmbeddedObject Class.

But I am facing a peculiar problem. If I copy and paste a screen shot, or copy and paste an image into a NotesRichText field then I could not retrieve the size of the field. Because these image is not fetched by embedded objects. NotesItem.ValuesLength does return the internal storage. I do not know what is it? :D. But surely it is not the size of that field. It is possible to get the size from the DXLExporter and NotesStream. But if I attach the pdf file then it is throwing error.

Simply say, I want to get the size of a rich text field.

Was it helpful?

Solution

What if you copy your richtext item to newly created document and check size of whole document? I think that is quite simple and easy solution (and will be not a problem with access as we do not need to save document). Then you do not need to care about different kind of data into richtext field.

...
Set rtitem = doc.Getfirstitem("body")
Dim newdoc As New NotesDocument(db)
Call rtitem.Copyitemtodocument(newdoc, "body")
print newdoc.Size
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top