Reputation: 329
with OpenXML in Word (not Office interop), using regex.replace to replace a ###Field### with strings. one ###Field3#### is in a table cell, and the replacement string needs a line break. Noting seems to work to insert a newline into a string in a Word table cell.
VbCrLf..no
CrLf...no
chr(13) no
Environment.NewLine.... no
There has to be a way to break a string into lines in a table cell:
"12345" + ???? + "DDDDDD" ---->
12335
DDDDD
Upvotes: 0
Views: 1653
Reputation: 5102
You need to insert a new Run into the same paragraph, after the Run that contains the Field.
Upvotes: 1