Specify formatting with OnMailMergeGetText ?

    • Offizieller Beitrag
    Zitat

    I'd like to have the ability to insert an open or checked box for boolean field values. Is it possible to specify formatting with OnMailMergeGetText?


    You have access to the current writing attribute through
    Contents.pMergeAttr^
    There you can set the font (GetFontNr!), Color etc.

    Using different StringValues for true/false you can draw checkboxes using the WingDing font:

    Code
    if inspname='TRUE' then
     begin
       Contents.pMergeAttr^.Font := WPRichText1.GetFontNr('WingDings');
       Contents.StringValue := #253;
     end else if inspname='FALSE' then
     begin
       Contents.pMergeAttr^.Font := WPRichText1.GetFontNr('WingDings');
       Contents.StringValue := #111;
     end;