We have created a merge field event handler like the following:
Private Sub ApplyListFormatOptionsEvent(sender As Object, args As MergeFieldEventArgs)
'Bullet / unordered list options
If args.CurrentMergeField.FieldCode.Contains(FIELD_FORMATTING_CODE_BULLETS_SQUARE) Then
args.Text = args.Text.Replace("<ul>", "<ul style=""list-style-type: square"">")
End If
If args.CurrentMergeField.FieldCode.Contains(FIELD_FORMATTING_CODE_BULLETS_CIRCLE) Then
args.Text = args.Text.Replace("<ul>", "<ul style=""list-style-type: circle"">")
End If
If args.CurrentMergeField.FieldCode.Contains(FIELD_FORMATTING_CODE_BULLETS_NONE) Then
args.Text = args.Text.Replace("<ul>", "<ul style=""list-style-type: none"">")
End If
'Numbered / ordered list options
If args.CurrentMergeField.FieldCode.Contains(FIELD_FORMATTING_CODE_NUMBERLIST_ROMAN_UPPER) Then
args.Text = args.Text.Replace("<ol>", "<ol type=""I"">")
End If
If args.CurrentMergeField.FieldCode.Contains(FIELD_FORMATTING_CODE_NUMBERLIST_ROMAN_LOWER) Then
args.Text = args.Text.Replace("<ol>", "<ol type=""i"">")
End If
If args.CurrentMergeField.FieldCode.Contains(FIELD_FORMATTING_CODE_NUMBERLIST_LETTERED_UPPER) Then
args.Text = args.Text.Replace("<ol>", "<ol type=""A"">")
End If
If args.CurrentMergeField.FieldCode.Contains(FIELD_FORMATTING_CODE_NUMBERLIST_LETTERED_LOWER) Then
args.Text = args.Text.Replace("<ol>", "<ol type=""a"">")
End If
End Sub
.. and added it like this: AddHandler document.MailMerge.MergeField, AddressOf ApplyListFormatOptionsEvent
It works great, unless we try having a merge field that would have two field formatting codes in the end, like {MERGEFIELD ProjectDescription \circlebullets \romanupper}. Those merge fields seem to not be recognised by the MailMerge at all, or at least they will not call any event nor will there be a printed record.
Is there some notation we are using wrongly, or is that an actual bug?