RichText.SetFormattedText
-------------------------

Sets new text for saving a document.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [RichText](component_RichText.md) | [3.5](newinversion35.md) | ✅ Yes | ❌ No | ❌ No | ✅ Yes, on macOS | ✅ Yes |

MBS( "RichText.SetFormattedText"; Text ) 

**MBS**( **"RichText.SetFormattedText";** /\* Sets new text for saving a document. \*/  
**$Text**) /\* The new text to use. Can have style information.e.g. "Hello World" \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| Text | The new text to use. Can have style information. | "Hello World" |

### Result

Returns OK or error.

### Description

Sets new text for saving a document.  
### Examples

From Styled text to RTF:

 Let ( \[   
// Custom function with pFormattedText as parameter  
  
r = MBS ( "[RichText.Clear](RichTextClear.md)" );  
vOK = MBS ( "RichText.SetFormattedText"; pFormattedText ) ;   
vResult = MBS ("[RichText.RTF](RichTextRTF.md)") ;  
vOK = MBS ( "[RichText.Release](RichTextRelease.md)" )  
  
\];   
  
vResult  
  
)  
### See also

- [RichText.AppendFormattedText](RichTextAppendFormattedText.md)
- [RichText.Clear](RichTextClear.md)
- [RichText.FormattedText](RichTextFormattedText.md)
- [RichText.ReadText](RichTextReadText.md)
- [RichText.Release](RichTextRelease.md)
- [RichText.RTF](RichTextRTF.md)
- [RichText.WriteDOC](RichTextWriteDOC.md)
- [RichText.WriteRTF](RichTextWriteRTF.md)

### Release notes

- **Version 14.5**
    - Improved styled text conversion on macOS to include better support for highlight, underline and strikethrough, e.g. for [RichText.SetFormattedText](https://www.mbsplugins.eu/RichTextSetFormattedText.shtml) and [Clipboard.SetStyledText](https://www.mbsplugins.eu/ClipboardSetStyledText.shtml) functions.

### Example Databases

- [Mac only/RichText/RichText](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/Mac%20only/RichText/RichText.shtml#5ScriptAnchor_)

### Blog Entries

- [MBS FileMaker Plugin, version 14.5pr4](https://www.mbsplugins.de/archive/2024-10-25/MBS_FileMaker_Plugin_version_1/monkeybreadsoftware_blog_filemaker)
- [New in the MBS FileMaker Plugin 10.0](https://www.mbsplugins.de/archive/2020-01-23/New_in_the_MBS_FileMaker_Plugi/monkeybreadsoftware_blog_filemaker)
- [MBS Filemaker Plugin, version 5.0pr5](https://www.mbsplugins.de/archive/2015-01-01/MBS_Filemaker_Plugin_version_5/monkeybreadsoftware_blog_filemaker)

This function is free to use.

Created 18th August 2014 , last changed 5th September 2025

  
[RichText.SetAttribute](RichTextSetAttribute.md) - [RichText.SetText](RichTextSetText.md)

[HTML Version](RichTextSetFormattedText.shtml)