Skip to content

Commit d105207

Browse files
committed
Modified the existing sample
1 parent 7c29bb8 commit d105207

File tree

1 file changed

+5
-7
lines changed
  • Paragraphs/Get-heading-list-value/.NET/Get-heading-list-value

1 file changed

+5
-7
lines changed

Paragraphs/Get-heading-list-value/.NET/Get-heading-list-value/Program.cs

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,11 @@ static void Main(string[] args)
2323
Console.WriteLine("No paragraphs with the style 'Heading 3' found.");
2424
else
2525
{
26-
foreach (Entity paragraph in headingParagraphs)
27-
{
28-
//Get the string that represents the appearance of list value of the paragraph.
29-
if (paragraph is WParagraph)
30-
Console.WriteLine((paragraph as WParagraph).ListString);
31-
else
32-
Console.WriteLine("The entity is not a WParagraph.");
26+
foreach (Entity entity in headingParagraphs)
27+
{
28+
WParagraph paragraph = entity as WParagraph;
29+
//Get the the heading number and the heading text together.
30+
Console.WriteLine(paragraph.ListString + paragraph.Text);
3331
}
3432
}
3533
//Pauses the console to display the output.

0 commit comments

Comments
 (0)