RichText

[property icon] RichText$

The text of the the control in rich text format

String property

Applies to: Rich Edit


>

RichText

This property is used to set or return the contents of the control in RTF format. The Text$ property can be used to return the unformatted text.

For example, the following could be used to place some formatted text into the control:

.rtfControl1.RichText$ = "{\rtf1\ansi\ansicpg1252\deff0\deftab720{\fonttbl{\f0\fswiss MS Sans Serif;}{\f1\froman\fcharset2 Symbol;}{\f2\fswiss\fprq2 Arial;}}{\colortbl\red0\green0\blue0;\red255\green0\blue0;}\deflang2057\pard\plain\f2\fs72\cf1 Hello World!\plain\f0\fs17 \par }"

and the following would retrieve both the formatted and unformatted text from the control:

Formatted$ = .rtfControl1.RichText$
Unformatted$ = .rtfControl1.Text$

Note: The Text$ and RichText$ properties are returned from the client. They will be correct and agree on entry to an event handler, but modifications to a rich text control within an event handler will not cause these properties to be updated until the event handler has completed.

See also

Rich Edit methods, properties and events.