Insert data using Bookmarks

I'm trying to fill-in a document full of many bookmarks in merge like manager. The idea is that I navigate to a bookmark, insert some text and move on to the next bookmark.

I would expected something like the following would have worked:
WordDocument doc = new WordDocument();
doc.Open(...);
BookmarksNavigator nav = new BookmarksNavigator( document );

foreach( Bookmark bk in doc.Bookmarks )
{
nav.MoveToBookmark( bk.Name, false, true );
string name = bookmark.Name;
nav.InsertText( name );
}

However, the result is that only some of the bookmarks are filled in and most are skipped. Is this the way to insert text at a bookmark location and if so why are only some getting filled in?

3 Replies

BP Bhuvaneswari P Syncfusion Team April 12, 2007 01:13 PM UTC

Hi Thomas,

I am afraid that I was unable to reproduce the issue that you have mentioned here.

Herewith I have attached the sample for your reference.
http://websamples.syncfusion.com/samples/DocIO.Windows/F59376/main.htm

Could you please try running the above sample and let me know still you are facing any problem, if not could you please modify the sample or provide me your word template to reproduce the issue, so that I would be able to reproduce the issue and investigate further on this issue.

Thank you for your interest in Syncfusion products.

Best Regards,
Bhuvaneswari


SZ Srdjan Zivojinovic April 25, 2007 01:39 PM UTC

Hi, Bhuvaneswari.

While experimenting with the bookmarks I was able to reproduce this error with your code.

I have only modified your template a bit.
Bookmarks are now located inside table cells.

I am sending you modified template.

Application finds bookmarks correctly but no text is written in some bookmarks.

Bookmark_Template_Table.zip


BP Bhuvaneswari P Syncfusion Team April 27, 2007 10:54 AM UTC

Hi Srdjan,

Thanks a lot for your file.

I was able to reproduce the issue. This issue has been fixed in our new version 5.1. Could you please open a Direct-Trac incident with regard to this issue, so that we can provide you the link to download the v5.1 version. Please open the new incident with the below subject.

Subject:59376- Insert data using Bookmarks

Please let me know if you have any other queries.

Thank you for your interest in Syncfudion products.

Best Regards,
Bhuvaneswari.

Loader.
Up arrow icon