Skip to content

Commit 74702a8

Browse files
Added comments
1 parent 9c24b99 commit 74702a8

File tree

1 file changed

+6
-5
lines changed
  • Tables/Replace-cell-content/.NET/Replace-cell-content

1 file changed

+6
-5
lines changed

Tables/Replace-cell-content/.NET/Replace-cell-content/Program.cs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,17 @@
1010
IWSection section = document.LastSection;
1111
//Get the first table in the section.
1212
WTable table = section.Body.Tables[0] as WTable;
13-
//Access the specific cells by their indices.
13+
//Access the instance of the cell (second row, second cell).
1414
WTableCell cell1 = table[1, 1];
15+
//Access the instance of the cell (third row, third cell).
1516
WTableCell cell2 = table[2, 2];
16-
//Clear the contents of the first cell.
17+
//Clear the contents of the cell (second row, second cell).
1718
cell1.ChildEntities.Clear();
18-
//Add a new paragraph with content to the first cell.
19+
//Add a new paragraph with content to the cell (second row, second cell).
1920
cell1.AddParagraph().AppendText("Adventure");
20-
//Clear the contents of the second cell.
21+
//Clear the contents of the cell (third row, third cell).
2122
cell2.ChildEntities.Clear();
22-
//Add a new paragraph with content to the second cell.
23+
//Add a new paragraph with content to the cell (third row, third cell).
2324
cell2.AddParagraph().AppendText("Cycle");
2425
//Save the modified document.
2526
using (FileStream outputFileStream = new FileStream(Path.GetFullPath("Output/Result.docx"), FileMode.Create, FileAccess.Write))

0 commit comments

Comments
 (0)