We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Assigning bookmark text returns 'Object reference not set to an instance of an object' error

Hi Aspose team,

I tried to set text of “Subject” bookmark in attached document to “”, but it returned “Object reference not set to an instance of an object” error.
(I’m using Aspose.Words 17.2)

This is my code :
document.Range.Bookmarks[“Subject”].Text = “”;

Do you have any clue for this ?
Best regards
Hi Roman,

Thanks for your inquiry. We have tested the scenario and have managed to reproduce the same issue at our side. For the sake of correction, we have logged this problem in our issue tracking system as WORDSNET-15012. You will be notified via this forum thread once this issue is resolved.

We apologize for your inconvenience.

Thank you Tahir

The issues you have found earlier (filed as WORDSNET-15012) have been fixed in this Aspose.Words for .NET 17.4 update and this Aspose.Words for Java 17.4 update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.

Thank you Aspose !! It worked.

Hi Aspose,

I have the same problem with this attactment “TemplWithContentControl.dot”.
The different this time : the “Subject” bookmark is a Content Control.
And when I tried to set its text to “”, it raised the error “Cannot insert a node of this type at this location.”.

Do you have any clue for this ?
Thank in advance.
Hi Roman,

Thanks for your inquiry. We have tested the scenario and have managed to reproduce the same issue at our side. For the sake of correction, we have logged this problem in our issue tracking system as WORDSNET-15194. The BookmarkEnd node of "Subject" is not in the content control. So, this exception is thrown.

You will be notified via this forum thread once this issue is resolved. We apologize for your inconvenience.

No problem :slight_smile: And thank you Tahir.

The issues you have found earlier (filed as WORDSNET-15194) have been fixed in this Aspose.Words for .NET 17.5 update and this Aspose.Words for Java 17.5 update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.