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
close icon

Bookmarks inside table multiple cells

Hi,
 
I have downloaded to trail version of DocIO and we are evaluating your product for use in our applications.
 
My first impressions are very positive and I really like the ease with which the product allows the creation and manipulation of documents.
 
I have a question regarding working with bookmarks in tables.
In our current implementations (using Word interop assemblies) we have many templates defined which use tables for document layout. We typically use bookmarks to either insert data into the templates, or to remove text based on boolean decisions.
Inserting data works like a charm, however de deletion of text marked by bookmarks often causes issues because the bookmarks are defined inside a table and usually span >1 cell. As per your documentation, we cannot use the DeleteBookmarkContent method of the BookmarkNavigator in these instances.
 
Is there a workaround we can utilize to overcome this limitation?
 
Thanks for your support,
 

5 Replies

DV Divyalakshmi Vasudevan Syncfusion Team December 26, 2014 12:59 PM UTC

 

Hi Peter,

Thank you for your interest in  Syncfusion products.

We are unable to reproduce the mentioned preservation issue with your mentioned scenario when using DeleteBookMarkContent method to delete the bookmark content in the document. For your reference, we have attached the sample which we have tried to reproduce the issue at our end. Please do find the sample from below link. Try running this sample and let us know if this helps you.

SampleLink:

http://www.syncfusion.com/downloads/support/directtrac/general/BookMark1006482997.zip



If still you are able to reproduce this issue then kindly provide us the sample along with all the input documents which you have used to reproduce this issue at your end, so that we could further analyze and update you with the appropriate details.

Please let us know if you have any other questions.

Regards,
Divyalakshmi V




PM Peter meulendijks December 27, 2014 12:19 PM UTC

Hi,

Thanks for your reply. I have looked at the sample you provided. The bookmark in your sample is contained within a single cell in the table, this works fine.
If you change the bookmark to include the cell containing the Test 1 Test 2 words and also the cell containing Test 3, the error will occur when you invoke DeleteBookmarkContent.
I can provide an example if still unclear.
According to your documentation this behaviour is expected, I'm looking for a workaround to achieve this.

Thanks for your support,

best regards,

Peter Meulendijks


SK Sathish K Syncfusion Team December 31, 2014 02:37 PM UTC

Hi Peter,

 

Thank you for your update.

 

Your requirement is possible by iterating the items between the bookmark start and bookmark end and remove those items from the document. We have prepared a sample to illustrate the same. Please find the attached sample and let us know if this helps you.

 

Please let us know if you have any other questions.

 

Regards,

Sathish


Attachment: Sample_8e2f936a.zip


PM Peter meulendijks January 6, 2015 12:00 PM UTC

Hi Sathish,

Thanks for your reply. Your sample is moving me in the right direction but I'm still struggling with 2 issues.

I have attached 2 sample templates you can use to reproduce them using your code sample.

If you use the Hello.docx template and run the sample, you will notice that cells Test4, Test5 and Test6 are being deleted. The intention was to only delete cells Test4 & Test6. If you select the bookmark in Word, only the cells containing Test4 & test6 are selected.

Secondly, for some reason, the BookmarkStart.OwnerParagraph property is always giving me the cell with index 0 in the row, even if the bookmark starts in a cell with a higher index.  If you test with Hello2.docx you can see this behaviour. I would expect the cells containing Yada2 & test6 to be deleted, but instead all the cells in the row are deleted.

Thanks for your assistance,

Peter

Attachment: sample_805b3046.zip


DV Divyalakshmi Vasudevan Syncfusion Team January 7, 2015 01:02 PM UTC

Hi Peter,

Thank you for your update

We are able to reproduce the mentioned “Bookmarks inside Multiple Cells” issue. We have created a Direct Trac incident 133699 for the further follow up. Kindly follow the incident 133699 to get resolved the mentioned issue. Kindly use the below link to login on Direct Trac

https://www.syncfusion.com/account/login?ReturnUrl=/support/directtrac/incidents

Please let us know if you have any other questions.

Regards,
Divyalakshmi V


Loader.
Live Chat Icon For mobile
Up arrow icon