WordsProcessing: InvalidOperationException when cloning a document containing fields spanning multiple paragraphs
InvalidOperationException when cloning a document containing fields spanning multiple paragraphs.
Workaround: instead of new paragraphs, use line breaks (Shift+Enter).
2 comments
ADMIN
Yoan
Posted on:18 Sep 2024 11:57
Hi Jeff,
Thank you for the provided feedback and additional context. I am sure it will be of great help to anyone encountering the same scenario. You're welcome to add any related information if something else comes to mind.
I get this error when the Word merge field contains a paragraph character in quotes (from hitting the return key) after \f (switch that inserts text after the field if the field is not blank). The desired result is for Word to go to the next line if the given merge field is blank. For example, if address 2 is not blank, the city, state and zip code should go to the next line.
The workaround is to use the shift + return key instead of just the return key in the merge field after the \f switch.