i have this code:
doc.Range.Bookmarks[“BookmarkSarvanRishum”].Text = string.Empty;
And I get the error:
Cannot insert a node of this type at this location
What is the problem??
Thanks for your inquiry. Please ZIP and attach your input Word document here for testing. We will investigate the issue on our side and provide you more information.
Thank you, but I found an answer in the forum;
Bookmark bookmark = doc.Range.Bookmarks[“bm”];
Node currentNode = bookmark.BookmarkStart;
bool flag = true;
while (currentNode != null
if (currentNode.NodeType == NodeType.BookmarkEnd)
Node nextNode =
currentNode = nextNode;
Thanks for your feedback. It is nice to hear from you that your problem has been solved. Please feel free to ask if you have any question about Aspose.Words, we will be happy to help you.
I see that it erases the bookmark, I want only to erase the text in the bookmark