ReliefJet Essentials™
for Microsoft Outlook
ReliefJet Essentials for Outlook is a comprehensive set of about 130 tools for performing a wide range of tasks in processing email messages, contacts, appointments, meetings, tasks and other Outlook items as well as Outlook / Exchange Server folders and mailboxes.
Download  Purchase
Latest News
  • ReliefJet Essentials for Outlook 4.5 is available for free download right now!

More... RSS
30 Days Moneyback Guarantee
Compatible with Windows 10

Using macros

Macros in ReliefJet Essentials for Outlook are special sequences of characters, which the program automatically replaces with certain values in certain cases. For example, in message subjects and texts such replacements are performed by the "Expand Macros" utility. There are common macros and special macros. Common macros can be used in settings of all the utilities, in specifying utility parameters in the command line, as well as in other places, such as message subject or text, if the utility supports that. Special macros are used in certain utilities only.

Here is the general syntax for using macros:

{MACRO:position and length#format?default value}

MACRO

Macro name (always entirely in uppercase).

Position and length

One number only specifies character count to be taken from the beginning or the end of the string (if the number is negative). If two numbers separated by comma, the first number is the character position from the beginning or the end of the string (if the number is negative); the second number is the character count to be taken from the position. In this case, if the first number is negative, the characters are counter in reverse order. If you specify the first number and a comma, but with no second number, all remaining characters in the string will be taken, starting from the position determined by the first number.

Examples:

{MACRO:5} five first characters of the string;

{MACRO:-5} five last characters of the string;

{MACRO:5,3} three characters, starting from the fifth position from the beginning of the string;

{MACRO:-5,3} three characters, starting from the fifth position from the end of the string counting in the reverse order;

{MACRO:5,} the end of the string, starting from the fifth position;

{MACRO:-5,} the beginning of the string up to the fifth position from the end of the string.

Format

Advanced appearance settings for certain macros.

Default value

Value to be used when parsing the macro produces empty string.

All the parameters, except macro name, are entirely optional. Macros can be used repeatedly in the same text.

It is often necessary to use macros when specifying file names; for example, in utilities like "Save Attachments". In such cases, you cannot use characters that are not allowed in file names. To automatically bring a macro value to the format that is allowed in file names, add the "asterisk" (*) character immediately following the opening curly bracket: {*MACRO}. This replaces all the invalid characters with "underscore" (_).

Common macros

The following macros are common and can be used in settings of the utilities, as well as in message subjects or texts, if the utility supports it:

NOW

Current date and time

Allows specifying format string (as described below).

If no format is specified, uses the full date and time representation taken from the operating system’s regional settings.

%VARIABLE

Environment variable value

Any macro name beginning with the "percent" (%) character is treated as environment variable name (such as %COMPUTERNAME%, %USERNAME% and any other).

Example:

{NOW#d.M.yyyy H:m:s} {%VARIABLE:3?None}

Suppose that the current date is December 31, 2011, and the current time is 23:59:59, and the value of the environment variable VARIABLE is its name (i.e. VARIABLE); then the specified string will be replaced with the following:

31.12.2011 23:59:59 VAR

If the value of the environment variable VARIABLE is not set, the string will look like this:

31.12.2011 23:59:59 Non

Please note that the value of the first macro is displayed as specified in the format string, while the second one is truncated to three characters.

Here are some possible values for the format string of the NOW macro:

Format specifier

Description

Examples

d

The day of the month, from 1 through 31.

6/1/2009 1:45:30 PM → 1
6/15/2009 1:45:30 PM → 15

dd

The day of the month, from 01 through 31.

6/1/2009 1:45:30 PM → 01
6/15/2009 1:45:30 PM → 15

ddd

The abbreviated name of the day of the week.

6/15/2009 1:45:30 PM → Mon (en-US)

dddd

The full name of the day of the week.

6/15/2009 1:45:30 PM → Monday (en-US)

f

The tenths of a second in a date and time value.

6/15/2009 13:45:30.617 → 6
6/15/2009 13:45:30.050 → 0

ff

The hundredths of a second in a date and time value.

6/15/2009 13:45:30.617 → 61
6/15/2009 13:45:30.005 → 00

fff

The milliseconds in a date and time value.

6/15/2009 13:45:30.617 → 617
6/15/2009 13:45:30.0005 → 000

F

If non-zero, the tenths of a second in a date and time value.

6/15/2009 13:45:30.617 → 6
6/15/2009 13:45:30.050 →

FF

If non-zero, the hundredths of a second in a date and time value.

6/15/2009 13:45:30.617 → 61
6/15/2009 13:45:30.005 →

FFF

If non-zero, the milliseconds in a date and time value.

6/15/2009 13:45:30.617 → 617
6/15/2009 13:45:30.0005 →

g

The period or era.

6/15/2009 1:45:30 PM → A.D.

h

The hour, using a 12-hour clock from 1 to 12.

6/15/2009 1:45:30 AM → 1
6/15/2009 1:45:30 PM → 1

hh

The hour, using a 12-hour clock from 01 to 12.

6/15/2009 1:45:30 AM → 01
6/15/2009 1:45:30 PM → 01

H

The hour, using a 24-hour clock from 0 to 23.

6/15/2009 1:45:30 AM → 1
6/15/2009 1:45:30 PM → 13

HH

The hour, using a 24-hour clock from 00 to 23.

6/15/2009 1:45:30 AM → 01
6/15/2009 1:45:30 PM → 13

m

The minute, from 0 through 59.

6/15/2009 1:09:30 AM → 9
6/15/2009 1:09:30 PM → 9

mm

The minute, from 00 through 59.

6/15/2009 1:09:30 AM → 09
6/15/2009 1:09:30 PM → 09

M

The month, from 1 through 12.

6/15/2009 1:45:30 PM → 6

MM

The month, from 01 through 12.

6/15/2009 1:45:30 PM → 06

MMM

The abbreviated name of the month.

6/15/2009 1:45:30 PM → Jun (en-US)

MMMM

The full name of the month.

6/15/2009 1:45:30 PM → June (en-US)

s

The second, from 0 through 59.

6/15/2009 1:45:09 PM → 9

ss

The second, from 00 through 59.

6/15/2009 1:45:09 PM → 09

t

The first character of the AM/PM designator.

6/15/2009 1:45:30 PM → P (en-US)

tt

The AM/PM designator.

6/15/2009 1:45:30 PM → PM (en-US)

y

The year, from 0 to 99.

1/1/0001 12:00:00 AM → 1
1/1/0900 12:00:00 AM → 0
6/15/2009 1:45:30 PM → 9

yy

The year, from 00 to 99.

1/1/0001 12:00:00 AM → 01
1/1/0900 12:00:00 AM → 00
6/15/2009 1:45:30 PM → 09

yyy

The year, with a minimum of three digits.

1/1/0001 12:00:00 AM → 001
1/1/0900 12:00:00 AM → 900
1/1/1900 12:00:00 AM → 1900
6/15/2009 1:45:30 PM → 2009

yyyy

The year as a four-digit number.

1/1/0001 12:00:00 AM → 0001
1/1/0900 12:00:00 AM → 0900
1/1/1900 12:00:00 AM → 1900
6/15/2009 1:45:30 PM → 2009

:

The time separator.

6/15/2009 1:45:30 PM → : (en-US)

/

The date separator.

6/15/2009 1:45:30 PM → / (en-US)

" or '

Literal string delimiter.

6/15/2009 1:45:30 PM ("s:" h:m t) → s: 1:45 P
6/15/2009 1:45:30 PM ('s:' h:m t) → s: 1:45 P

\

The escape character.

6/15/2009 1:45:30 PM (h \h) → 1 h

Any other character

The character is copied to the result string unchanged.

6/15/2009 1:45:30 AM (a hh:mm t) → a 01:45 A

Special macros

Special macros depend on the type and application context of the utility. For example, the MAILBOX macro is available only when using command line, while FROM is available only in certain utilities that work with messages.

Here is the list of special macros:

DATE

Message date

The same formatting rules apply to message date as to the NOW macro.

SUBJECT

Message subject

When using the macro in file names, remember that message subject may be very long and may contain invalid characters. The beginning of the chapter describes how to avoid these problems.

FROM

Message sender

Sender’s name and email address.

Optionally, you can use one of the following values as a format string:

EMAIL – email address,

USER – email address user (part of the address before @),

DOMAIN – email address domain (part of the address after @),

NAME – full name,

FIRST – first name (part of the full name before the first space),

LAST – last name (part of the full name after the first space).

Example:

"{FROM#NAME?Noname}" <{FROM#EMAIL??@?}>

This string will be expanded into the full email address of the sender. When no address is specified, the result will instead appear as:

"Noname" <?@?>

TO

Message recipient

In case of multiple recipients, uses the first one on the list. This macro accepts the format of the FROM macro.

ATTACHMENTS

Item attachments

The list of Outlook item attachments.

By using the format string, you can put single or double quotation marks around each attachment’s name and specify the list separator.

Example:

{ATTACHMENTS#', }

If you have two attachments named Document 1.docx and Document 2.docx in your message, the result of macro expansion will appear as:

'Document 1.docx', 'Document2.docx'

FOLDER

Item folder

Full path to currently being processed Outlook item’s folder.

Optionally, you can use one of the following values as a format string:

NAME – folder name only (without full path),

PATH – folder path ready to use in the file system (all invalid file name characters replaced with ‘_’ character),

ROOT – the name of the root folder full path element (mailbox, data file, etc.).

MAILBOX

Mailbox

Full email address of currently being processed mailbox. The macro applies only when using the Mailbox command-line parameter. The format is the same as of the FROM macro.

FILE

Data file

Full path to currently being processed PST data file. The macro applies only when using the File command-line parameter.

Optionally, you can use one of the following values as a format string:

NAME – filename only (without directory and extension),

PATH – file directory only (without filename),

EXT – file extension only (for example, PST).

Example:

{FILE#PATH}\{FILE#NAME}.txt

This string will be expanded into the full path to the file with extension replaced to .txt. I.e. if the path of the file is C:\My Files\Outlook.pst then the result will appear as: C:\My Files\Outlook.txt.