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

Adding tables at a bookmark location

Thread ID:





69016 Oct 10,2007 08:33 AM UTC Oct 17,2007 01:31 PM UTC WinForms 1
Tags: DocIO
Jason Finch
Asked On October 10, 2007 08:33 AM UTC

Does anyone have an example of how to add a table at a bookmark. I had working code in v4.2 and have since recently upgraded.

Now I am have difficulties correcting the code.

Old code was:
IWTable table = (WTable) bookmark.InsertParagraphItem(ParagraphItemType.Table);

The problems I see:
The enum ParagraphItemType.Table no longer appears in the current build.

bookmark.GetBookmarkContent() brings back a TextBodyPart. I am unsure if I can add tables to this object.

Any starting tips?


Melba Winshia [Syncfusion]
Replied On October 17, 2007 01:31 PM UTC

Hi Jason,

We regret for the delayed response.

You can add a table at a bookmark location by getting the table in the TextBodyPart and replacing the bookmark by using this TextBodyPart.


BookmarksNavigator bn = new BookmarksNavigator(doc);

//Select a table
TextBodyPart bodyPart = new TextBodyPart(replaceDoc);
bodyPart.BodyItems.Add(replaceDoc.LastSection.Body.Tables[0] as WTable);


//Replace with table

Please refer the sample in the below link which illustrates the above:


Please try this and let me know if this helps.



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