Visual Basic: RichTextBox Control
Supported RTF Codes
The RichTextBox control recognizes the following RTF (Rich Text Format) codes. All other RTF codes are ignored by the control when loading text.
Note Some of the codes listed below may not appear as expected. For example, the UnderlineDouble (uldb) code appears as a single underline.
Warning If a code is not explicitly supported, it may be stripped from the RTF source file when the SaveFile method is used.
RTF Code | Description | RTF Code | Description |
- | OptionalHyphen | objcropl | CropLeft |
\n | EndParagraph | objcropr | CropRight |
\r | EndParagraph | objcropt | CropTop |
_ | NonBreakingHyphen | objdata | ObjectData |
| | FormulaCharacter | object | Object |
~ | NonBreakingSpace | objemb | ObjectEmbedded |
ansi | CharSetAnsi | objh | Height |
b | Bold | objicemb | ObjectMacICEmbedder |
bin | BinaryData | objlink | ObjectLink |
blue | ColorBlue | objname | ObjectName |
bullet | ANSI Character 149 | objpub | ObjectMacPublisher |
cb | ColorBackground | objscalex | ScaleX |
cell | Cell | objscaley | ScaleY |
cf | ColorForeground | objsetsize | ObjectSetSize |
colortbl | ColorTable | objsub | ObjectMacSubscriber |
cpg | CodePage | objw | Width |
deff | DefaultFont | par | EndParagraph |
deflang | DefaultLanguage | pard | ParagraphDefault |
deftab | DefaultTabWidth | pc | CharSetPc |
deleted | Deleted | pca | CharSetPs2 |
dibitmap | PictureWindowsDIB | piccropb | CropBottom |
dn | Down | piccropl | CropLeft |
dy | TimeDay | piccropr | CropRight |
emdash | ANSI Character 151 | piccropt | CropTop |
endash | ANSI Character 150 | pich | Height |
f | FontSelect | pichgoal | DesiredHeight |
fbidi | FontFamilyBidi | picscalex | ScaleX |
fchars | FollowingPunct | picscaley | ScaleY |
fcharset | CharSet | pict | Picture |
fdecor | FontFamilyDecorative | picw | Width |
fi | IndentFirst | picwgoal | DesiredWidth |
field | Field | plain | CharacterDefault |
fldinst | FieldInstruction | pmmetafile | PictureOS2Metafile |
fldrslt | FieldResult | pn | ParaNum |
fmodern | FontFamilyModern | pnindent | ParaNumIndent |
fname | RealFontName | pnlvlblt | ParaNumBullet |
fnil | FontFamilyDefault | pntext | ParaNumText |
fontemb | FontEmbedded | pntxta | ParaNumAfter |
fontfile | FontFile | pntxtb | ParaNumBefore |
fonttbl | FontTable | protect | Protect |
footer | NullDestination (Footer) | qc | AlignCenter |
footerf | NullDestination (Footer, first) | ql | AlignLeft |
footerl | NullDestination (Footer, left) | qr | AlignRight |
footerr | NullDestination (Footer, right) | rdblquote | ANSI Character 34 |
footnote | NullDestination (footnote) | red | ColorRed |
fprq | Pitch | result | ObjectResult |
froman | FontFamilyRoman | revauth | RevAuthor |
fs | FontSize | revised | Revision |
fscript | FontFamilyScript | ri | IndentRight |
fswiss | FontFamilySwiss | row | Row |
ftech | FontFamilyTechnical | rquote | ANSI Character 39 |
ftncn | NullDestination (Footnote cont.) | rtf | Rtf |
ftnsep | NullDestination (Footnote separ) | rtlch | RightToLeftChars |
ftnsepc | NullDestination (Footnote cont. separ) | rtldoc | RightToLeftDocument |
green | ColorGreen | rtlmark | DisplayRightToLeft |
header | NullDestination (Header) | rtlpar | RightToLeftParagraph |
headerf | NullDestination (Header, first) | sec | TimeSecond |
headerl | NullDestination (Header, left) | sect | EndSection |
headerr | NullDestination (Header, right) | sectd | SectionDefault |
horzdoc | HorizontalRender | strike | StrikeOut |
hr | TimeHour | stylesheet | StyleSheet |
I | Italic | sub | Subscript |
info | DocumentArea (Info fields) | super | Superscript |
intbl | InTable | tb | TabPosition |
lang | Language | tc | NullDestination (Table of contents) |
lchars | LeadingPunct | tx | TabPosition |
ldblquote | ANSI Character 34 | ul | Underline |
li | IndentLeft | uld | UnderlineDotted |
line | SoftBreak | uldash | UnderlineDash |
lquote | ANSI Character 39 | uldashd | UnderlineDashDotted |
ltrch | LeftToRightChars | uldashdd | UnderlineDashDotDotted |
ltrdoc | LeftToRightDocument | uldb | UnderlineDouble |
ltrmark | DisplayLeftToRight | ulhair | UnderlineHairline |
ltrpar | LeftToRightParagraph | ulnone | StopUnderline |
mac | CharSetMacintosh | ulth | UnderlineThick |
macpict | PictureQuickDraw | ulw | UnderlineWord |
margl | MarginLeft | ulwave | UnderlineWave |
marglsxn | SectionMarginLeft | up | Up |
margr | MarginRight | v | HiddenText |
margrsxn | SectionMarginRight | vertdoc | VerticalRender |
min | TimeMinute | wbitmap | PictureWindowsBitmap |
mo | TimeMonth | wbmbitspixel | BitmapBitsPerPixel |
nocwrap | NoWordBreak | wbmplanes | BitmapNumPlanes |
nooverflow | NoOverflow | wbmwidthbytes | BitmapWidthBytes |
nosupersub | NoSuperSub | wmetafile | PictureWindowsMetafile |
nowwrap | NoWordWrap | xe | NullDestination (index entry) |
objautlink | ObjectAutoLink | yr | TimeYear |
objclass | ObjectClass | zwj | ZeroWidthJoiner |
objcropb | CropBottom | zwnj | ZeroWidthNonJoiner |