0

Using DocX I need to do something like this:

  1. A long text description.

Except I need the "1." to be a paragraph and the "A long text description" to be a paragraph. I cannot use a list for this.

JRene
  • 27
  • 5

1 Answers1

1

late answer, but use a 2 column table with no visible borders

some code i hacked out of my current thing. this makes a table and populates the cells with the contents of my cells, you'd just need to make a table, with 2 columns. and then iterate build a row with with cell[0] for the numeral, and cell[1] for the sentence

doc.InsertParagraph("Table Title: " + (component).SubTitle, false, SubtitleStyle);
var table = doc.AddTable(component.ColumnCount, component.RowCount);

int rowcount = 0;
foreach (DataCell datacell in component.TableData)
{
    table.Rows[rowcount].Cells[0].Paragraphs.First().Append(rowcount+1);
    table.Rows[rowcount].Cells[1].Paragraphs.First().Append(datacell.CellValue);
    rowcount++;
}
doc.InsertTable(table);
dvandamme
  • 26
  • 6
  • Thank you for responding. Unfortunately I wasn't able to do it this way either because the user needed to be able to copy and paste parts of the document without the table formatting. I ended up just making it the same paragraph with some spacing. – JRene Jun 29 '16 at 15:37