The below table mentions the formats that are accepted for visual labels in All the plugins -Word, Excel, PowerPoint and Outlook.
...
Option
...
agent allows for formatting to be specified for visual labels using HTML. However, only specific HTML tags are used as MS Office applications don’t support all possible HTML tags (such as images). As such, this is a guide on what features are supported by the agent’s visual tagging, and how to write some basic labels, with examples. For more advanced labels, it is recommended to get familiar with writing HTML.
Basic Labels
Here is an example of the most basic possible example. All visual labels must start with <span>
and end with </span>
. In the below example, {classification}
will be replaced with the chosen classification value (eg, Public, General Business, etc). This applies no formatting at all, default values will be applied (more info below).
Code Block | ||
---|---|---|
| ||
<span>Classification: {classification}</span> |
Label Styles
It is possible to apply style options to the text such as text colour, where colour is defined as Hex code (see here for a colour picker to get Hex codes). You can also use HTML colour names instead of Hex codes.
Code Block | ||
---|---|---|
| ||
<span style="color:#00FF00">Classification: {classification}</span> |
Code Block | ||
---|---|---|
| ||
<span style="color:DarkTurquoise">Classification: {classification}</span> |
And here is an example of choosing the font family:
Code Block | ||
---|---|---|
| ||
<span style="font-family:Calibri">Classification: {classification}</span> |
To apply more than one style, the different options must separated by a semi-colon, such as:
Code Block | ||
---|---|---|
| ||
<span style="color:#00FF00;font-family:Calibri">Classification: {classification}</span> |
If you want to apply a different style to only some of the text, you can do so by adding more <span>
tags. In the below example only the classification will have the colour applied, but all of the text will be Calibri. NOTE: if you add an opening <span>
tag. there must be a corresponding closing </span>
tag.
Code Block | ||
---|---|---|
| ||
<span style="font-family:Calibri">Classification: <span style="color:#00FF00">{classification}</span></span> |
Label Formatting
It also possible to make text bold, italic, underlined or strike-through. Using some special tag types. These are:
Bold |
|
Italic |
|
Underline |
|
Strike-through |
|
Note how these all require opening and closing tags, as with <span>
. Here is an example of how these can be used:
Code Block | ||
---|---|---|
| ||
<span style="color:#00FF00;font-family:Calibri">Classification: <strong><em>{classification}</em></strong></span> |
NOTE: tags must be closed in the reverse order in which they were opened. Since tags can contain other tags, you cannot close a tag before you have closed any tags contained within them.
For example, this is incorrect as the <em>
tag was opened after the <strong>
tag.
Code Block | ||
---|---|---|
| ||
<strong><em>Incorrect</strong></em> |
The correct way to do this is:
Code Block | ||
---|---|---|
| ||
<strong><em>Correct</em></strong> |
Line breaks
It is possible to add multiple lines to visual labels. If a label is too long to fit on one line it will automatically wrap around to the next line as expected, but it is possible to deliberately split the label into different lines using the <br>
tag. Note that unlike all other tags used by the agent, the <br>
tag does not require a closing tag.
Code Block | ||
---|---|---|
| ||
<span>Line 1<br>Line 2</span> |
All Supported Styles/Tags
Here is a list of all supported styles and tags in the agent as well as examples for their usage. Other HTML tags are ignored and not used by the agent, and may cause unintended problems, so it best to just use the below options when writing labels.
Option | Example | Notes | |||||
---|---|---|---|---|---|---|---|
Text colour |
| Defaults to black if not specified | |||||
Background colour |
| Defaults to transparent if not specified | |||||
Font Family |
| Defaults to Calibri if not specified | |||||
Font Size |
| Defaults to 10px if not specified | |||||
Text Alignment |
| Default depends on the application. Either default text alignment for the document, or left aligned | |||||
Bold |
| ||||||
Italic |
| ||||||
Underline |
| ||||||
Strike-through |
| ||||||
Line break |
|
Other HTML tags are ignored and not used for formatting.Here is an example that uses all supported styles and tags:
Code Block | ||
---|---|---|
| ||
<span style="color:#FFFFFF;background-color:#FF0000;font-family:Calibri;font-size:10px;text-align:center">Classification: <strong><em>{classification}</em><strong><br><u><s>Classified by GetVisibility</s></u></span> |
Which produced the following as a header visual label on a blank Word document:
...