Macro > Content >

www.MacroToolworks.com

Text Macro

 

Text macro allows user to create a rich unicode text with full font formatting and images. The macro can be created by clicking on the "Add Text Macro" button as shown here:

 

 

The macro can look like this:

 

These text formatting features are supported:

Bold

Italic

Underline

Fonts

Colors

Bullets

Numbering

Indention

Alignment

Hyper-links

Pictures

Horizontal lines

 

When macro is executed then the macro text is copied to the clipboard and pasted in other application.

 

Variables Replacement

 

Text macro can also contain variables (see variables and system variables). In such case, when macro is executed then the variables are replaced by the variable value - for example by the current date. In order to use variable replacement feature the text macro must be run from within a general macro using RUN MACRO / <run> command. The general macro sets the variables to the required values and then the text macro is executed using RUN MACRO / <run> command. Here is an example:

 

This is a simple text macro:

 

And this is the general macro that sets "ga_Today" and "ga_Tomorrow" variables and then runs the text macro:

(Note: Make sure that user defined variables used in text macro always have "ga_" prefix - for example, "ga_MyVariable1".)

 

When the general macro runs the result is this (in MS  Word):
 

Today date: Sunday, March 10, 2019
Tomorrow date: Monday, March 11, 2019

 

Expression Replacement

 

Text macro can also contain expressions (see expressions). For example, the text "1+1 = EXPR(1+1)" will provide output "1+1 = 2".