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. Image for the cookie policy date

Insert BookmarkEnd into Section.ChildEntities

Hi Vijayakumar,

Please send me the attachment, which you gave on the Thread 90238

I am also having the issue on section.childentities insert ""Cannot insert an object to SectionChildEntities collection."

Regards
Charulatha Suryakumar

1 Reply

SK Sathish K Syncfusion Team July 23, 2014 01:10 PM UTC

Hi Charulatha,

 

Thank you for your interest in Syncfusion products.

 

The entity “BookMarkEnd” is the child entity of paragraph. So we can’t insert that as a section’s child entity. You can insert this into the paragraph child entities collection. Kindly use the below code to achieve this.

 

WordDocument document = new WordDocument();

//Adding one section and one paragraph to the word document

document.EnsureMinimal();

//Instantiating the BookmarEnd instance

Syncfusion.DocIO.DLS.BookmarkEnd end = new Syncfusion.DocIO.DLS.BookmarkEnd(document,"BM") ;

//Insert that into the paragraph child entities collection.

document.LastParagraph.ChildEntities.Insert(index, end);

 

Kindly refer the below UG documentation link to know more about bookmarks:

http://help.syncfusion.com/ug/windows%20forms/default.htm#!documents/bookmark.htm

 

Please let us know if you have any other questions.

 

Regards,

Sathish


Loader.
Live Chat Icon For mobile
Up arrow icon