how can i add multiple lines to field value in word using C#

here is my code
<<Doc_No>> is my field entity in word template document ,

i would like to display multiple lines in word with one Field value can any one suggest me to get this solution



Thnks in advance

 if (Field.Code.Text.Contains("Doc_No"))
                                                            {
                                                                Field.Select();
                                                                objWord.Selection.TypeText("" + dtH.Rows[H]["DocNo"].ToString() + "");
                                                            }
Venkat ManiAnalyst ProgrammerAsked:
Who is Participating?
 
zephyr_hex (Megan)Connect With a Mentor DeveloperCommented:
Use "\n" in your string.

So, for example:  "This is my sentence.\nThis is my other sentence"
Will appear as:

This is my sentence.
This is my other sentence

remember that \ needs to be escaped in C#, so you could do:

string.Format("This is my sentence.{0}This is my other sentence", "\\n");

Open in new window

0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.