We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

WordDocument accessing table via bookmark

Thread ID:





131945 Aug 4,2017 10:52 AM UTC Aug 10,2017 09:49 AM UTC WPF 3
Tags: DocIO
Asked On August 4, 2017 10:52 AM UTC

Hello. I'm trying to access the table in a Word document by bookmark. I can access it just fine but when I change some text in a table or try to add rows, there is no change visible in the saved document. I'm attaching the code which accesses the table.

Vijay Ramachandran [Syncfusion]
Replied On August 7, 2017 08:48 AM UTC

Hi Tim,

Thank you for contacting Syncfusion support.

On analyzing further with the given details, we found that you have used GetBookmarkContent() method to get the particular bookmark text body. Then you have finds the table and added the text into each cell of this table.

Since the GetBookmarkContent() method is used to get the bookmark content as cloned text body, the changes made in the cloned text body wasn’t reflected in original Word document. If your requirement is changing the Word document content means, then kindly replace the existing text body with new text body(text added to each cell) by using our BookmarksNavigator.ReplaceBookmarkContent() API. Kindly add the below highlighted code in your sample to resolve the reported problem.
    var part = bookmarkNavigator.GetBookmarkContent();
if(part.BodyItems.FirstItem is IWTable table)
foreach(WTableRow row in table.Rows)
foreach (WTableCell cell in row.Cells)
foreach (WParagraph paragraph in cell.Paragraphs)
                    paragraph.Text =


We have also prepared demo sample for this scenario, please find the sample from here and let us know if it helps.

Vijay R

Replied On August 10, 2017 09:37 AM UTC

It works now. Thanks for your help.

Sethumanikkam Yogendran [Syncfusion]
Replied On August 10, 2017 09:49 AM UTC

Hi Tim,

Thank you for your update.

We are happy to hear that the provided sample resolved your requirement. Please let us know if you need any further assistance on this. We will be happy to assist you as always.

Please let us know if you have any other questions.



This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon