InputMergeField and preserving an existing field's attribute

  • Julian,

    Let's say I have a merge field already in the document. I want to replace it with a different one if the user double-clicks the existing merge code.

    Currently I'm doing something like this:

    WPRichText1.SelectFieldAtCP( TRUE, TRUE );
    WPRichText1.DeleteFieldAtCP;
    InputMergeField( strMergeField, strMergeField ) ;

    It works fine, except for one thing. I want to preserve the existing merge code's font characteristics (name, size, style, etc). Instead what seems to be happening is it's picking up the font characteristics to use for the replacement merge code based on something else in the line, such as the attributes at the beginning of the line, which frequently is different than the font attributes of the merge code itself.

    How do I tuck away the font and style attributes (e.g., underlined, bolded, etc), of the existing merge code so I can apply those exact same attributes to the replacement merge code?

    Thanks..:)

    Regards,
    diamond