Macro > Content >

www.MacroToolworks.com

Clipboard Macro

 

Clipboard macro allows user to persist any clipboard content within macro file and paste this clipboard content any time. The clipboard macro can be created by clicking on the "Add Clipboard Macro" button:

 

 

(Note: When creating clipboard macro the current clipboard content is immediately used.)

 

The macro can look like this:

When the macro is executed then the persisted macro content is loaded to the clipboard and then pasted to the application in which the macro is executed.

 

There are these operations supported from the clipboard macro toolbar:

Execute macro

Copy the clipboard macro content to clipboard

Paste the clipboard content to the clipboard macro

Remove unwanted clipboard formats from the macro

Shrink the clipboard data preview to fit the view area 

 

Parameters Replacement

 

Clipboard macro can also contain parameters to be replaced. In such case, when macro is executed then the parameters are replaced by the required values. In order to use parameter replacement feature the clipboard macro must be run from within a general macro using RUN MACRO / <run> command. Here is an example:

 

This is the Clipboard Macro (named "invoice1_clp"). It contains an invoice template created in MS Word. Notice highlighted parameters:

 

This is the general macro. It defines variables used to replace the parameters in the clipboard macro:

 

 

When this general macro is run then it produces output like this (in MS Word). Notice the parameters replaced by defined values:

 

Variables Replacement

 

Clipboard macro can also contain variable in format %variable%. If the variable exists (see variables and system variables) then it is replaced by its value. This provides the same benefit as parameters replacement but it is in many cases easier.

 

Expression Replacement

 

Clipboard macro can also contain expressions (see expressions). For example, if the clipboard macro contains this text "1+1 = EXPR(1+1)" then it will provide output "1+1 = 2".