File tree Expand file tree Collapse file tree 1 file changed +8
-17
lines changed
Expand file tree Collapse file tree 1 file changed +8
-17
lines changed Original file line number Diff line number Diff line change 11using Syncfusion . DocIO . DLS ;
22using Syncfusion . DocIO ;
33
4- namespace Extract_comments
4+ //Open an existing document
5+ using ( FileStream inputStream = new FileStream ( @"../../../Data/Template.docx" , FileMode . Open , FileAccess . Read ) )
56{
6- internal class Program
7+ using ( WordDocument document = new WordDocument ( inputStream , FormatType . Docx ) )
78 {
8- static void Main ( string [ ] args )
9+ //Iterate through the comments in the Word document
10+ foreach ( WComment comment in document . Comments )
911 {
10- //Open an existing document
11- using ( FileStream inputStream = new FileStream ( @"../../../Data/Template.docx" , FileMode . Open , FileAccess . Read ) )
12- {
13- using ( WordDocument document = new WordDocument ( inputStream , FormatType . Docx ) )
14- {
15- //Iterate through the comments in the Word document
16- foreach ( WComment comment in document . Comments )
17- {
18- //Traverse each paragraph from the comment body items
19- foreach ( WParagraph paragraph in comment . TextBody . Paragraphs )
20- Console . WriteLine ( paragraph . Text ) ;
21- }
22- }
23- }
12+ //Traverse each paragraph from the comment body items
13+ foreach ( WParagraph paragraph in comment . TextBody . Paragraphs )
14+ Console . WriteLine ( paragraph . Text ) ;
2415 }
2516 }
2617}
You can’t perform that action at this time.
0 commit comments