WebView.GetFormattedText
------------------------

Queries the current text of the document.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [WebView](component_WebView.md) | [5.0](newinversion50.md) | ✅ Yes | ✅ Yes | ❌ No | ❌ No | ✅ Yes |

MBS( "WebView.GetFormattedText"; WebViewerRef ) 

**MBS**( **"WebView.GetFormattedText";** /\* Queries the current text of the document. \*/  
**$WebViewerRef**) /\* Either the Web Viewer Object Name or the Web Viewer ID as returned by "[WebView.FindByName](WebViewFindByName.md)" function. \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| WebViewerRef | Either the Web Viewer Object Name or the Web Viewer ID as returned by "[WebView.FindByName](WebViewFindByName.md)" function. |  |

### Result

Returns text or error.

### Description

Queries the current text of the document.  
If possible with formatting, but only the text. This may show more/less text than you see.  
  
See also [WebView.GetPlainText](WebViewGetPlainText.md), [WebView.GetHTMLText](WebViewGetHTMLText.md) and WebView.  
Alternative you can run JavaScript to query document.body.parentElement.outerHTML yourself and convert HTML to styled text.  
  
Implemented for Windows using [WebView.GetHTMLText](WebViewGetHTMLText.md) and [Text.HTMLtoStyledText](TextHTMLtoStyledText.md) function in plugin version 15.5.  
### Examples

Query plain text from WebViewer:

 MBS ("[WebView.GetPlainText](WebViewGetPlainText.md)"; "web")  
Query html text from WebViewer:

 MBS ("[WebView.GetHTMLText](WebViewGetHTMLText.md)"; "web")  
Query formatted text from WebViewer:

 MBS ("WebView.GetFormattedText"; "web")  
Query selected text:

 MBS ("[WebView.SelectedText](WebViewSelectedText.md)"; "web")  
### See also

- [Text.HTMLtoStyledText](TextHTMLtoStyledText.md)
- [WebView.CopyFormattedText](WebViewCopyFormattedText.md)
- [WebView.FindByName](WebViewFindByName.md)
- [WebView.GetForm](WebViewGetForm.md)
- [WebView.GetHTMLText](WebViewGetHTMLText.md)
- [WebView.GetPlainText](WebViewGetPlainText.md)
- [WebView.SelectedText](WebViewSelectedText.md)

### Release notes

- **Version 15.5**
    - Implemented [WebView.GetFormattedText](https://www.mbsplugins.eu/WebViewGetFormattedText.shtml) for Windows using [Text.HTMLtoStyledText](https://www.mbsplugins.eu/TextHTMLtoStyledText.shtml) internally.
- **Version 10.1**
    - Added handing of Strikethrough text attribute for styled text conversion from NSAttributedString to FileMaker. Affects [WebView.GetFormattedText](https://www.mbsplugins.eu/WebViewGetFormattedText.shtml), [Clipboard.GetStyledText](https://www.mbsplugins.eu/ClipboardGetStyledText.shtml), [RichText.FormattedText](https://www.mbsplugins.eu/RichTextFormattedText.shtml) and other functions.
- **Version 8.2**
    - Implemented [WebView.GetFormattedText](http://www.mbsplugins.eu/WebViewGetFormattedText.shtml), [WebView.CopyFormattedText](http://www.mbsplugins.eu/WebViewCopyFormattedText.shtml) and [RichText.ReadWebviewer](http://www.mbsplugins.eu/RichTextReadWebviewer.shtml) for iOS and FileMaker 16.

### Example Databases

- [WebViewer/Custom WebView](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/WebViewer/Custom%20WebView.shtml#4ScriptAnchor_)
- [WebViewer/WebView Selected Text](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/WebViewer/WebView%20Selected%20Text.shtml#6ScriptAnchor_)

### Blog Entries

- [MBS FileMaker Plugin, version 15.5pr3](https://www.mbsplugins.de/archive/2025-10-13/MBS_FileMaker_Plugin_version_1/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 10.1pr6](https://www.mbsplugins.de/archive/2020-03-02/MBS_FileMaker_Plugin_version_1/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 8.2pr7](https://www.mbsplugins.de/archive/2018-05-14/MBS_FileMaker_Plugin_version_8/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin 5.0 for OS X/Windows - More than 3000 Functions In One Plugin](https://www.mbsplugins.de/archive/2015-02-24/MBS_FileMaker_Plugin_50_for_OS/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 5.0pr11](https://www.mbsplugins.de/archive/2015-02-13/MBS_FileMaker_Plugin_version_5/monkeybreadsoftware_blog_filemaker)

This function checks for a license.

Created 12nd February 2015 , last changed 12nd October 2025

  
[WebView.GetFormValue](WebViewGetFormValue.md) - [WebView.GetHTMLText](WebViewGetHTMLText.md)

[HTML Version](WebViewGetFormattedText.shtml)