RichText.SetAttribute
---------------------

Sets metadata.

| 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.SetAttribute"; Key; Value ) 

**MBS**( **"RichText.SetAttribute";** /\* Sets metadata. \*/  
**$Key**; /\* The new attribute key. Can be Title, Company, Copyright, Subject, Author, Keywords, Comment, Editor, ModificationTime, Manager or Category.e.g. "Title" \*/   
**$Value**) /\* The value of the attribute. Most are text parameters except for the timestamp of ModificationTime.e.g. "My title" \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| Key | The new attribute key. Can be Title, Company, Copyright, Subject, Author, Keywords, Comment, Editor, ModificationTime, Manager or Category. | "Title" |
| Value | The value of the attribute. Most are text parameters except for the timestamp of ModificationTime. | "My title" |

### Result

Returns OK or error.

### Description

Sets metadata.  
See [RichText.Attribute](RichTextAttribute.md) for details.  
### Examples

Set title:

 MBS ( "RichText.SetAttribute"; "Title"; "Hello World")  
Set paper size:

 MBS ( "RichText.SetAttribute"; "PaperSize"; 595; 842) // A4  
### See also

- [RichText.Attribute](RichTextAttribute.md)
- [RichText.WriteDOC](RichTextWriteDOC.md)
- [RichText.WriteRTF](RichTextWriteRTF.md)

### Release notes

- **Version 9.2**
    - Added PaperSize option to [RichText.SetAttribute](http://www.mbsplugins.eu/RichTextSetAttribute.shtml) and [RichText.Attribute](http://www.mbsplugins.eu/RichTextAttribute.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 9.2pr6](https://www.mbsplugins.de/archive/2019-05-03/MBS_FileMaker_Plugin_version_9/monkeybreadsoftware_blog_filemaker)

This function is free to use.

Created 18th August 2014 , last changed 3th May 2019

  
[RichText.ReplaceTexts](RichTextReplaceTexts.md) - [RichText.SetFormattedText](RichTextSetFormattedText.md)

[HTML Version](RichTextSetAttribute.shtml)