Reputation: 76
I am trying simple to output some text from c# program to a new Word document but I have a weird problem: a lot of my output is coming upside down. Any word that doesn't end up with a letter is jumping to the end of the sentence. For example:
DocX doc= DocX.Create(filePath);
Paragraph p1 = template.InsertParagraph();
p1.AppendLine("This line contains a ").Append("bold").Bold().Append(" word.");
p1.AppendLine("Here is example with question mark?");
p1.AppendLine();
p1.AppendLine("Can you help me figure it out?");
p1.AppendLine();
As you can see the sentences that end up with non letter are getting mixed up. I am using 2010 Office Word
Upvotes: 2
Views: 2545
Reputation: 236
Try instead
Paragraph p1 = template.InsertParagraph();
use this
Paragraph p1 = doc.InsertParagraph();
Upvotes: 1