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

Document.Bookmarks.FindByName works, but initially Document.Bookmakrs.Count is 0

Hi,

I'm using bookmarks as kind of placeholder, but I want to remove them all after I'm done with the document.

I tried document.Bookmarks.Clear() then tried while(document.Bookmarks.Count > 0) document.Bookmarks.RemoveAt(0);

but then I realised it does not seem to actually load in the bookmarks initially... the count is always 0 - is there some sort of document.Bookmarks.Init() or something to fill the bookmark collection? Or perhaps something that could be done in the WordDocument() Constructor?

Cheers,
Carl.

5 Replies

RH Ramanan  Hariharasubramanian Syncfusion Team August 2, 2017 09:36 AM UTC

Hi Carl,

Thank you for contacting Syncfusion support.

We are unable to reproduce the reported issue from our side. We have prepared a sample based on your requirement which can downloaded from the following link.

Sample link: http://www.syncfusion.com/downloads/support/forum/131883/ze/Sample1108399142

Kindly modify this sample to reproduce the issue and share us the issue reproducing sample along with input document which will be helpful for us to provide you a prompt solution at the earliest.

Please let us know if you have any concerns.


Regards,
Ramanan H.

 



CH Carl Heavisides August 3, 2017 02:32 PM UTC

Hi Ramanan,

Thanks for that sample to work with (makes things easier)

It does seem to be a specific problem after a mailmerge

I've attached an updated sample and you'll see that after you click "Generate Document" the delivered document still has the bookmarks - and if you debug through you'll see after the mail merge the document.Bookmarks collection has been emptied.

Cheers,

Carl.


Attachment: bookmarkissue_dabd34b7.zip


SY Sethumanikkam Yogendran Syncfusion Team August 4, 2017 09:55 AM UTC

Hi Carl,

Thank you for your update.

We are glad to inform you that the reported issue has been already fixed and the fix already included in our 2017 Volume 3 release which is expected to be out by this week.

Please let us know if you have any other questions.

Regards,
Sethumanikkam.Y



CH Carl Heavisides August 4, 2017 10:26 AM UTC

that's great, thanks!

Carl.



RH Ramanan  Hariharasubramanian Syncfusion Team August 7, 2017 05:05 AM UTC

Hi Carl,

Thanks for your update.

Please let us know if you have any other questions.

Regards,
Ramanan H.

Loader.
Live Chat Icon For mobile
Up arrow icon