Text.TextToRTF
--------------

Creates RTF text for a given FileMaker formatted styled text.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [Text](component_Text.md) | [2.4](newinversion24.md) | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |

MBS( "Text.TextToRTF"; Text ) 

**MBS**( **"Text.TextToRTF";** /\* Creates RTF text for a given FileMaker formatted styled text. \*/  
**$Text**) /\* Formatted text to convert.e.g. "Hello World" \*/ 

(old name: TextToRTF)

### Parameters

| Parameter | Description | Example |
|---|---|---|
| Text | Formatted text to convert. | "Hello World" |

### Result

some text you could put into rtf file.

### Description

Creates RTF text for a given FileMaker formatted styled text.   
Currently only ANSI text encoding. Supports styles like bold, italic, underline, font size and text color. Other style features may be added in the future on demand.  
Can be used with [Clipboard.SetRTFText](ClipboardSetRTFText.md) to bring styled text to the clipboard.  
### Examples

Convert some text to RTF

 MBS ( "Text.TextToRTF"; "Hello World" )  
<small>  
Example result:   
{\\rtf1\\ansi\\ansicpg1252  
Hello World  
}</small>Convert some text to HTML

 MBS ( "[Text.TextToHTML](TextTextToHTML.md)"; "Hello World" )  
<small>  
Example result:   
&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"&gt;  
&lt;html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de"&gt;  
&lt;head&gt;  
&lt;meta http-equiv="content-type" content="application/xhtml+xml; charset=utf-8" /&gt;  
&lt;/head&gt;  
&lt;body&gt;  
&lt;p&gt;Hello World&lt;/p&gt;&lt;/body&gt;  
&lt;/html&gt;</small>Write RTF file:

 Set Variable \[$rtf ; Value:MBS ( "Text.TextToRTF"; "Hello World äöü ß" )\]  
Set Variable \[$r ; Value:MBS ( "[Text.WriteTextFile](TextWriteTextFile.md)"; $rtf ; "/Users/cs/Desktop/test.rtf"; "Windows")\]  
### See also

- [Clipboard.SetRTFText](ClipboardSetRTFText.md)
- [Clipboard.SetStyledText](ClipboardSetStyledText.md)
- [Text.TextToHTML](TextTextToHTML.md)
- [Text.WriteTextFile](TextWriteTextFile.md)

### Release notes

- **Version 14.1**
    - Changed [Text.TextToRTF](https://www.mbsplugins.eu/TextTextToRTF.shtml) function to use RTF parser from macOS/iOS and Windows for these platforms.
    - Improved our RTF parser for [Text.TextToRTF](https://www.mbsplugins.eu/TextTextToRTF.shtml) and [Clipboard.GetStyledText](https://www.mbsplugins.eu/ClipboardGetStyledText.shtml) function.

### Example Databases

- [Text functions/Text to RTF or HTML](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/Text%20functions/Text%20to%20RTF%20or%20HTML.shtml#4ScriptAnchor_)

### Blog Entries

- [MBS FileMaker Plugin, version 14.1pr6](https://www.mbsplugins.de/archive/2024-03-07/MBS_FileMaker_Plugin_version_1/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 14.1pr4](https://www.mbsplugins.de/archive/2024-02-26/MBS_FileMaker_Plugin_version_1/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 5.4pr4](https://www.mbsplugins.de/archive/2015-10-29/MBS_FileMaker_Plugin_version_5/monkeybreadsoftware_blog_filemaker)
- [Sending Email with FileMaker via MBS Plugin](https://www.mbsplugins.de/archive/2014-09-29/Sending_Email_with_FileMaker_v/monkeybreadsoftware_blog_filemaker)

### FileMaker Magazin

- [Ausgabe 5/2014, Seite 25](https://filemaker-magazin.de/neuigkeit/3759-Appetithappen-FMM_201405)

This function checks for a license.

Created 18th August 2014 , last changed 11st December 2016

  
[Text.TextToHTML](TextTextToHTML.md) - [Text.Tidy](TextTidy.md)

[HTML Version](TextTextToRTF.shtml)