user743094
user743094

Reputation: 329

vb.net Ms Word Table cell. How to insert a line break into a string?

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

Answers (1)

jn1kk
jn1kk

Reputation: 5102

You need to insert a new Run into the same paragraph, after the Run that contains the Field.

Upvotes: 1

Related Questions