Case
I need to add custom macro to WORD to convert the entered data.
Solution
- Create a new [Source code] schema in the configuration.
- The schema content should be taken from the DateTimeExpressionConveter schema.
- From line 22, change the code for the needed one:
ExpressionConverterAttribute("<MacrosName>")]
public class <MacrosName>ExpressionConveter : IExpressionConverter {
public string Evaluate(object value, string arguments = "") {
string dateFormat = "dd.MM.yyyy";
if (!arguments.IsNullOrEmpty()) {
dateFormat = arguments;
}
DateTime date;
if (DateTime.TryParse((string)value, out date)) {
return date.ToString(dateFormat);
}
return string.Empty;
}
}Addding macro to the displayed value is performed in Word, read more at https://academy.bpmonline.com/documents/technic-sdk/7-7/how-create-own-…