Performing a mailmerge

  • Hi,

    I am trying to create the same functionality with
    RTF2PDF as I did in a first test (winforms) using TextDynamic.
    However, in the TD-solution I used:

    Code
    Dim memo As WPDynamic.IWPMemo = WPShow.Memomemo.LoadFromFile(ofd.FileName, True, "")memo.ShowFields = Truememo.MergeText("")

    This resulted in the event OnFieldGetText being raised for every mergefield.
    This works fine.

    Then in the webpage, using RTF2PDF, I perform the following code:

    Code
    AddHandler p.OnFieldGetText, AddressOf WP_OnFieldGetText
    p.Memo.LoadFromFile(Server.MapPath("Sjabloon/Template.rtf"), True, "")
    p.Memo.MergeText("")

    Unfortunately, p.Memo.Text contains the contents from the RTF including the
    mergefields but WP_OnFieldGetText is never called.

    Does anyone know what I am doing wrong or better, how to do it right?

    Thanx!

    Ferry

    • Offizieller Beitrag

    Hi,

    An alternative to do mail merge uses the method

    TextCursor.CPMoveNextObject

    Here you can specify 1 for ObjType to find the merge fields.

    You can then use CurrObj to update the data according to CurrObj.Name.