Skip to content

Commit 1f57930

Browse files
Modified the iteration code snippet
1 parent a7c2996 commit 1f57930

File tree

1 file changed

+3
-1
lines changed
  • Word-document/Continue-numbering-different-styles/Continue-numbering-different-styles

1 file changed

+3
-1
lines changed

Word-document/Continue-numbering-different-styles/Continue-numbering-different-styles/Program.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,10 @@
1616
// Initialize a variable to hold the list style from the destination document.
1717
ListStyle listStyle = null;
1818
// Iterate through the paragraphs in the last section of the destination document.
19-
foreach (WParagraph paragraph in destinationDocument.LastSection.Paragraphs)
19+
int countOfParagraph = destinationDocument.LastSection.Paragraphs.Count;
20+
for (int i = countOfParagraph-1;i>=0;i--)
2021
{
22+
WParagraph paragraph = destinationDocument.LastSection.Paragraphs[i];
2123
if (paragraph.ListFormat.CurrentListStyle != null)
2224
{
2325
// Get the current list style.

0 commit comments

Comments
 (0)