TextDocument: only call substitution method if it is used
One typical usage of substitution is Event_setTextContentFromNotificationMessage
which uses notification message to set the subject and the body of mail
message, which calls the substitution method twice, even if in most of
the cases the subject does not embed any substitution.