@@ -16,11 +16,11 @@ static void Main(string[] args)
1616 // Create the bookmark navigator instance
1717 BookmarksNavigator bookmarkNavigator = new BookmarksNavigator ( document ) ;
1818 // Move to the bookmark
19- bookmarkNavigator . MoveToBookmark ( "bkmk1 " ) ;
19+ bookmarkNavigator . MoveToBookmark ( "Adventure_Bkmk " ) ;
2020 // Get the bookmark content
2121 TextBodyPart part = bookmarkNavigator . GetBookmarkContent ( ) ;
2222 // Iterate through the content (implement this according to your needs)
23- IterateTextBody ( part . BodyItems ) ;
23+ IterateTextBodyPart ( part . BodyItems ) ;
2424 // Replace the bookmark content with modified content
2525 bookmarkNavigator . ReplaceBookmarkContent ( part ) ;
2626 //Creates file stream.
@@ -36,7 +36,7 @@ static void Main(string[] args)
3636 /// Iterates through the body contents of the Word document.
3737 /// </summary>
3838 /// <param name="textBodyItems"></param>
39- private static void IterateTextBody ( EntityCollection textBodyItems )
39+ private static void IterateTextBodyPart ( EntityCollection textBodyItems )
4040 {
4141 // Iterates through each of the child items of WTextBody
4242 for ( int i = 0 ; i < textBodyItems . Count ; i ++ )
@@ -77,7 +77,7 @@ private static void IterateTextBody(EntityCollection textBodyItems)
7777 if ( blockContentControl != null && blockContentControl . TextBody != null )
7878 {
7979 // Iterates the body items of Block Content Control.
80- IterateTextBody ( blockContentControl . TextBody . ChildEntities ) ;
80+ IterateTextBodyPart ( blockContentControl . TextBody . ChildEntities ) ;
8181 }
8282 break ;
8383 }
@@ -98,7 +98,7 @@ private static void IterateTable(WTable table)
9898 {
9999 //Table cell is derived from (also a) TextBody
100100 //Reusing the code meant for iterating TextBody
101- IterateTextBody ( cell . ChildEntities ) ;
101+ IterateTextBodyPart ( cell . ChildEntities ) ;
102102 }
103103 }
104104 }
@@ -123,12 +123,12 @@ private static void IterateParagraph(ParagraphItemCollection paraItems)
123123 case EntityType . TextBox :
124124 //Iterates to the body items of textbox.
125125 WTextBox textBox = entity as WTextBox ;
126- IterateTextBody ( textBox . TextBoxBody . ChildEntities ) ;
126+ IterateTextBodyPart ( textBox . TextBoxBody . ChildEntities ) ;
127127 break ;
128128 case EntityType . Shape :
129129 //Iterates to the body items of shape.
130130 Shape shape = entity as Shape ;
131- IterateTextBody ( shape . TextBody . ChildEntities ) ;
131+ IterateTextBodyPart ( shape . TextBody . ChildEntities ) ;
132132 break ;
133133 case EntityType . InlineContentControl :
134134 //Iterates to the paragraph items of inline content control.
0 commit comments