Merging data into richtext templates

  • Hi

    Not sure how to go about this using the WPtools suite. I have a template document created using Word. I want to replace
    - individual words (eg Name, Address)
    - table rows (lists eg employess, products)
    - paragraphs (eg clauses included/excluded)

    I would prefer the client to be able to create the template in Word or any WYSIWIG environment and the do the replacement in code, using Delphi.

    Is it possible,
    Thanks.

    • Offizieller Beitrag

    Hi,

    Zitat

    I would prefer the client to be able to create the template in Word or any WYSIWIG environment and the do the replacement in code, using Delphi.

    For best results use a WPTools editor directly, there are actually few things making sense in a merging letter which WPTools does not not. Esspecially the image handling is quite easier.

    Zitat

    I want to replace
    a) individual words (eg Name, Address)
    b) table rows (lists eg employess, products)
    c) paragraphs (eg clauses included/excluded)

    a) use placeholders such as <NAME> and use the ReplaceTokens API to convert to mail merge fields.

    b) also create a placeholder, maybe a table with header, data + footer row. See the CreateTable demo which can modify a table 'on thwe floy', insert rows as needed.

    c) I also thin you are best if you use <..> placeholders here. Thios is actually not so easy to do since the mailmerge is not able to remove text 'on the fly'. This might be added in a future version (or WPReoprter) but currently I have no out-of-the-box solution.

    Julian Ziersch