WebView.ExecCommand
-------------------

Executes a command on Windows IE.

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

MBS( "WebView.ExecCommand"; WebViewerRef; Command; ShowUI { ; Parameter } ) 

**MBS**( **"WebView.ExecCommand";** /\* Executes a command on Windows IE. \*/  
**$WebViewerRef**; /\* Either the Web Viewer Object Name or the Web Viewer ID as returned by "[WebView.FindByName](WebViewFindByName.md)" function. \*/   
**$Command**; /\* The command to pass.e.g. "Print" \*/   
**$ShowUI**; /\* Whether to show user interface.  
Pass 1 to enable user interface or 0 to disable.e.g. 1 \*/   
**$Parameter**) /\* Optional; The parameter to pass.  
Number, text or boolean are currently passed. \*/ 

### Parameters

| Parameter | Description | Example | Flags |
|---|---|---|---|
| WebViewerRef | Either the Web Viewer Object Name or the Web Viewer ID as returned by "[WebView.FindByName](WebViewFindByName.md)" function. |  |  |
| Command | The command to pass. | "Print" |  |
| ShowUI | Whether to show user interface.   Pass 1 to enable user interface or 0 to disable. | 1 |  |
| Parameter | The parameter to pass.   Number, text or boolean are currently passed. |  | Optional |

### Result

Returns OK, Failed or error.

### Description

Executes a command on Windows IE.  
Returns OK if command was sent successfully. Returns Failed if command was not sent. Returns other windows errors, e.g. if WebViewer was not found.  
### Examples

Print WebViewer:

 MBS ( "Webview.ExecCommand"; "web"; "Print"; 1)  
Select all text:

 MBS ( "Webview.ExecCommand"; "web"; "SelectAll"; 1)  
### See also

- [WebView.FindByName](WebViewFindByName.md)
- [WebView.SendCommand](WebViewSendCommand.md)

### Release notes

- **Version 7.3**
    - Added [Webview.SendCommand](http://www.mbsplugins.eu/WebviewSendCommand.shtml) and [Webview.ExecCommand](http://www.mbsplugins.eu/WebviewExecCommand.shtml).

### Example Databases

- [WebViewer/Windows only/WebViewer Commands on Windows](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/WebViewer/Windows%20only/WebViewer%20Commands%20on%20Windows.shtml#1Button55.0000000890.000000078.00000001005.0000000LayoutObjectAnchor_)

### Blog Entries

- [MBS FileMaker Plugin, version 7.3pr1](https://www.mbsplugins.de/archive/2017-06-05/MBS_FileMaker_Plugin_version_7/monkeybreadsoftware_blog_filemaker)

This function checks for a license.

Created 31st May 2017 , last changed 4th November 2021

  
[WebView.Evaluate](WebViewEvaluate.md) - [WebView.Favicon](WebViewFavicon.md)

[HTML Version](WebViewExecCommand.shtml)