OK I'll try to explain it again.
We use WsTools in two ways
- Template Editor - allows uses to insert mail merge fields into text that look like
<<StudentName>> or <<StudentPapers>>
- As a Letter Generator run against the database and the previously described template.
<<StudentName>>is replacesd with Sid West in the mail merge event and the format that was applied to <<StudentName>> in the template applies to Sid West in the generated letter.
The problem I have is when I try to replace <<StudentPapers>> with
110 100 Accounting
127 101 Maths
127 207 Advanced Maths
The users want to apply format to the template, such as bullet points or numbering or bold etc..
When I resolve the mail merge field I get the rows from the database and concatenate them into a string with –
while not dataSet.Eof do
begin
s := '';
for i := 0 to pred(dataSet.FieldCount) do
begin
s := s + trim(dataSet.Fields[i].AsString) + ' ';
end;
result := result + ' \plain\fs22 ' + s + ' \par ';
end;
dataset.Next;
end;
and set this string into the letter with –
contents.StringValue := My_List_of Papers;
in the OnMailMergeGetText event
This replaces the field <<StudentPapers>> with the list of papers. But
if the field was bulleted only the first row of the list has bullet points.
If the field was bold no rows of the list are bold.
If the field was numbered only the first row is numbered.
I have tried using TParagraphs but this adds a blank row above and below the list and the bullets still donot work. a single bullet appears on the first blank row. In this case the code per row from the database is
par := rte.ActiveText.AppendPar;
par.SetText(s);
Can you help?
Jeff