I am using openxml WordProcessingDocument to open a Word template and replace placeholder x1 with a string. This works fine unless I need the string to contain a newline. How can I replace x1 with text may contain newlines that word would recognise? I have tried \n \r but these do not work
Just to explain further when the word template is opened I read it into a StreamReader then use .Replace to replace x1.
.Replace(Environment.NewLine, "</w:t><w:br/><w:t>")
might work for you. – BrainSlugs83