Text includes text paragraphs and text runs, rich text styles, rich text paragraph styles, and tabs. A text run is text until the style changes or the paragraph ends.
To find text in a rich text item, use the NotesRichTextNavigator methods in conjunction with the type RTELEM_TYPE_TEXTPARAGRAPH or RTELEM_TYPE_TEXTRUN. To get text, create a NotesRichTextRange object and delineate the text with the following methods:
For example, if you find an element of type RTELEM_TYPE_TEXTPARAGRAPH with NotesRichTextNavigator, then call SetBegin passing it the navigator, your range starts at that paragraph.
The NotesRichTextRange class has the following properties:
Property |
Data Type |
Description |
---|---|---|
(Read-only) A navigator confined to the range. This allows you, for example, to get the text runs in a text paragraph. |
||
(Read-only) The style of the first text run in the range. |
||
String |
(Read-only) The text of the first paragraph in the range. |
|
String |
(Read-only) The text of the first run in the range. |
|
String |
(Read-only) The type of the first element in the range. |
In addition to SetBegin and SetEnd, the NotesRichTextRange class has the following methods:
To create text in a rich text item, use the following methods:
You can access rich text style properties through the NotesRichTextStyle class. The NotesRichTextStyle class contains the following properties:
Property |
Data Type |
Description |
---|---|---|
Boolean or Constant |
(Read-write) Bold rich text attribute. |
|
Constant |
(Read-wite) Effects (emboss, extrude, etc.). |
|
Integer |
(Read-write) Font size in points. |
|
Boolean |
Indicates whether all rich text style attributes are at the default state. |
|
Boolean or Constant |
(Read-write) Italic rich text attribute. |
|
Constant |
(Read-write) Color rich text attribute. |
|
Constant |
(Read-write) Font rich text attribute. |
|
NotesSession |
The session that contains a RichTextStyle object. For COM only. |
|
Boolean |
(Read-write) HTML attribute. |
|
Boolean or Constant |
(Read-write) Strikethrough rich text attribute. |
|
Boolean or Constant |
(Read-write) Underline rich text attribute. |
AppendStyle appends a style to the end of a rich text item. Text following the style is rendered using that styles's attributes until another style is appended.
Use a NotesRichTextStyle object with AppendStyle in NotesRichTextItem. At creation, all the NotesRichTextStyle attributes are in the default state STYLE_NO_CHANGE (255).
Use GetNotesFont in NotesRichTextItem to establish font identifiers for NotesFont.
The NotesRichTextParagraphStyle allows you to access the following attributes of a rich text paragraph object:
Property |
Data type |
Description |
---|---|---|
Constant |
(Read-write) Alignment attribute of a rich text paragraph. |
|
Long |
(Read-write) First line left margin attribute of a rich text paragraph. |
|
Constant |
(Read-write) Interline spacing attribute of a rich text paragraph. |
|
Long |
(Read-write) Left margin attribute of a rich text paragraph. |
|
Long |
(Read-write) Right margin attribute of a rich text paragraph. |
|
Constant |
(Read-write) Spacing above attribute of a rich text paragraph. |
|
Constant |
(Read-write) Spacing below attribute of a rich text paragraph. |
|
Variant |
(Read-only) Tabs in a rich text paragraph style. |
Use the CreateRichTextParagraphStyle method of NotesSession to create a new rich text paragraph style object.
You can manipulate the tabs in a rich text paragraph style object through the ClearAllTabs, SetTab, and SetTabs and Clear methods in the NotesRichTextParagraphStyle and RichTextTab classes.
The following table lists the properties in the RichTextTab class.