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

Finding a text values marked with Bookmarks

Thread ID:

Created:

Updated:

Platform:

Replies:

104396 Jul 16,2012 04:54 PM UTC Jul 20,2012 12:59 PM UTC ASP.NET Web Forms (Classic) 4
loading
Tags: DocIO
Brian Acierni
Asked On July 16, 2012 04:54 PM UTC

Hello,
 
I currently using DocIO and im trying to extract text values from a Word document.  The values are in a table formate and each cell contains a text value with a corresponding Bookmark assigned to it.  The reasoning for using bookmarks is that the Word document can contain x amount of tables.  So i thought creating bookmarks would be the easiest way to find the table values.
 
 The problem im having is that my code is able to find the Bookmark but the coorresponding text value is not correct.  Its seems that its grabing the value of the first cell not matter which Bookmark I search by.  When i go to "Bookmarks" in Word and select a Bookmark and click "Go To",  the correct value is highlighted (the bookmark point the corresponding value). 
 
I've attached a sample document with 3 bookmarks that DocIO is not finding the correct values.  Below is the code i'm using.  Can you provide any ideas as to why DocIO is not extracting the correct values?  Or can you provide a better way that i should be trying to find the values in a table?
 
Thanks for any help you can provide.
 

private string GetBookMarkValue(IWordDocument doc, string bookMarkName)

{

string value = "";

Bookmark bm = doc.Bookmarks[bookMarkName];

if (bm != null)

{

value = bm.BookmarkStart.OwnerParagraph.Text;

}

return value;

}



File_5e2f9f9e.zip

Ramkumar M [Syncfusion]
Replied On July 17, 2012 09:21 AM UTC

Hi Brain                                  

Thank you for your interest in Syncfusion product

We have analyzed your document and found that you have added the bookmark by selecting cell instead of selecting text in the cell, by doing this bookmark start and end inserted over different textbody(cells) instead of in a single paragraph. Currently using DocIO it is not possible to get the content of bookmark if the bookmark start and end presents in different textbody(cells).

As a workaround select only the text in the cell and then add appropriate bookmark.  For your reference we have modified your document to place the bookmark start and end inside a single paragraph and prepared a video to illustrate this workaround. Please find the sample with modified document and the video from the following link and let us know if this helps you.

Modified document:

http://www.syncfusion.com/downloads/Support/DirectTrac/95371/Sample-872376323.zip

Video:                        

http://www.syncfusion.com/downloads/Support/DirectTrac/95371/workaround901824322.zip

Please let us know if you have any other questions.

Regards

Ramkumar


Brian Acierni
Replied On July 19, 2012 04:39 AM UTC

wow...  thanks.  You were correct in that the bookmark was not being created correctly.  That table was being generated by some VBA code and it wasn't adding the bookmarks correctly.  Thanks for a quick reply and for the code example/video.
 
Top notch support!

Ramkumar M [Syncfusion]
Replied On July 20, 2012 12:59 PM UTC

Hi Brain,


You're welcome. Please let us know if you have any other questions.


Regards,

Ramkumar


Ramkumar M [Syncfusion]
Replied On July 20, 2012 12:59 PM UTC

Hi Brain,


You're welcome. Please let us know if you have any other questions.


Regards,

Ramkumar


CONFIRMATION

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

or the page will be automatically redirected to 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

;