Handling of Rich Text objects
Simple example of creation of section and adding a rich text
In order to create a rich text item the objects must be first added to
rtContainer object. The containers and objects are quite independent and an object as a rule may be simultaneously added to several containers.
Note however that using it in this way may not always work. The recommended way is to associate the object with only one container. In order to associate it with other container first use rtSomeObject.remove() to disassociate with parent container then rtTargetObject.add rtSomeObject to attach it in another place.
The sequence of creation of a simple rich text item:
Dim ctx as new rtContainer ' container exists independently of Notes objects until AppendItemValue or ReplaceItemValue method is executed
Set sect = new rtSection
Any objects that may contain other objects like sections has a Content property, that returns rtContainer object. The Content may be used to retrieve (and write rich text item) on any level of containment.
As a result of this code we have a rich text container containing title and section with the content of mail document "Body" item.
Now we can preserve the result:
Sect.isCollapsed = true ' make section collapsed
Done - the body item of mail document is saved in a collapsed section.
See more detailed description in reference section concerning the specific object classes.