# FTC Word-Exporter

**Current Version:** 1.0.0 (08. May 2018)

![](https://3296382369-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LMJF6lPoRP6_dqCo8LI%2F-LMNk0cH4fNB0uNTkfRf%2F-LMNk2NDAfwwMGoCS6wX%2FFTCtoWord-min.jpg?alt=media\&token=3fcad341-7693-481f-94eb-500aff53495a)

The class is a subclass of **FTIteratorBase**. This is available in all versions of FTC greater than or equal to version 3.0. Users of older FTC versions should use the demo class with version 2.4.1 to see if their **FTIteratorBase** is already compatible with the class. I developed the class for FTC versions >= 3.

You can download the latest version of the **Formatted Text Control 3.2.1** here:

{% embed url="<https://github.com/atomiccity/FormattedTextControl>" %}

You need a valid license for the [MBS-Compression](http://www.monkeybreadsoftware.de/xojo/plugin-compression.shtml) or [Chilkat-Plugin](https://www.chilkatsoft.com) to successfully compress the Word document!

It is also possible to write your own export method if you use TTsZipPackage, Einhugur plugins etc.

{% embed url="<https://www.dropbox.com/s/kozbvuu81xgspu7/WordIterator.xojo_binary_code?dl=0>" %}
Demo-Project
{% endembed %}

This demo runs only in debug mode and only with MBS Plugin. Simply drag and drop the WordIterator class into the Xojo Navigator and make sure that you have also imported the FTC classes so that the **FTIteratorBase** class is found. You will also find the call to save the FTC as a Microsoft Word document in the overview.

The class creates valid Microsoft Word documents (.docx) and was tested under macOS, Windows and Linux and exports all important formatting properties of the FTC:

## Character Properties

|                 | Microsoft Word | Apple Pages | Libre Office |
| --------------- | :------------: | :---------: | :----------: |
| BackgroundColor |        ✔       |      ✔      |       ✔      |
| Bold            |        ✔       |      ✔      |       ✔      |
| Italic          |        ✔       |      ✔      |       ✔      |
| Strikethrough   |        ✔       |      ✔      |       ✔      |
| Superscript     |        ✔       |      ✔      |       ✔      |
| Subscript       |        ✔       |      ✔      |       ✔      |
| TextColor       |        ✔       |      ✔      |       ✔      |
| TextFont        |        ✔       |      ✔      |       ✔      |
| TextSize        |        ✔       |      ✔      |       ✔      |
| Underline       |        ✔       |      ✔      |       ✔      |

## StyleRun

|              | Microsoft Word | Apple Pages | Libre Office |
| ------------ | :------------: | :---------: | :----------: |
| ColorOpacity |        ✔       |      —      |       —      |
| Hyperlink    |        ✔       |      ✔      |       ✔      |
| Picture      |        ✔       |      ✔      |       ✔      |
| Shadow       |        ✔       |      ✔      |       —      |

## Paragraph Properties

|                                                       | Microsoft Word | Apple Pages | Libre Office |
| ----------------------------------------------------- | :------------: | :---------: | :----------: |
| <p>Alignment</p><p>(<em>left, center, right)</em></p> |        ✔       |      ✔      |       ✔      |
| <p>BackgroundColor</p><p><em>(only local)</em></p>    |        ✔       |      ✔      |       ✔      |
| TabStops                                              |        ✔       |      ✔      |       ✔      |
| **Indentation**                                       |                |             |              |
| FirstIndent                                           |        ✔       |      ✔      |       ✔      |
| LeftMargin                                            |        ✔       |      ✔      |       ✔      |
| RightMargin                                           |        ✔       |      ✔      |       ✔      |
| **Spacing**                                           |                |             |              |
| AfterSpace                                            |        ✔       |      ✔      |       ✔      |
| BeforeSpace                                           |        ✔       |      ✔      |       ✔      |
| LineSpacing                                           |        ✔       |      ✔      |       ✔      |

## Document Properties

|                                                          | Microsoft Word | Apple Pages | Libre Office |
| -------------------------------------------------------- | :------------: | :---------: | :----------: |
| BackgroundColor                                          |        ✔       |      —      |       ⁇      |
| DefaultHyperlinkColor                                    |        ✔       |      ✔      |       ⁇      |
| DefaultHyperlinkColorVisited                             |        ✔       |      —      |       ⁇      |
| DefaultTabStop                                           |        ✔       |      ✔      |       ⁇      |
| <p>Margins</p><p><em>(Top, Left, Bottom, Right)</em></p> |        ✔       |      ✔      |       ✔      |
| <p>Size</p><p><em>(Width, Height)</em></p>               |        ✔       |      ✔      |       ✔      |
| Zoom                                                     |        ✔       |      —      |       ✔      |

{% hint style="info" %}
If you use a Page Background color <> white you should define a default Paragraph Style via FTC.DefaultParagraphStyle-Event. Otherwise all Paragraphs without ParagraphStyle have a white background color. But normally, you shouldn’t use a Page Background Color.
{% endhint %}
