Click here to Skip to main content
15,898,889 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i can add a text and an image to a word document using docx dll.but the text is not aligned to left side, its coming as justify by default in the document. how to align the text to left by default ? do i need to use any keyboard keys like Ctrl + L in c# to align the text to left side.

C#
  Novacode.Image img = doc.AddImage(strFinalImagePath);
  Picture pic = img.CreatePicture();

  foreach (Paragraph p in doc.Paragraphs)
  {
  var valuesIndex = p.FindAll("pre_setup");
  if (valuesIndex.Count > 0)
  {
   p.Append(strText).AppendLine("").AppendPicture(pic).AppendLine("");
  //p.Direction = Novacode.Direction.LeftToRight;
   p.Alignment = Alignment.left;
   p.AppendLine("");
}
}


Thanks in Advance
Posted
Updated 17-Feb-15 0:45am
v8

1 solution

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900