"Flatten" merge fields?

  • My application contains a collection of WPTools documents containing merge fields. I have a client request to be able to export these documents; as part of the export process, they need me to convert the merge fields. The placeholders need to be converted to text.

    I admittedly do not see the value in this but, hey, the client is paying for it!

    I know I can use the GetFieldList method to retrieve a list of the merge fields in my document but is there a way to convert them from merge fields to literal text? The text that should appear in place of the merge tag is the merge field's id.

    Thanks.