Good day -
My team is experiencing an issue in Aspose.Words when replacing bookmark contents.
I have attached a document with a very simple example. In it, you will see something like the following:
[Benefits]
Pricing
Pricing above should be orange.
where [Benefits] is actually the word Benefits, plus a line break, contained within a bookmark called BenefitsSection
What we often do is delete a chunk of text (including images, etc.) in a document by removing the bookmark and its contents; in this case:
(this is ColdFusion)
<cfset bookmark = templateDoc.Range.getBookmarks().get(“BenefitsSection”)>
<cfset bookmark.setText("")>
<cfset bookmark.remove()>
However, when we do that, the style of the following text - Pricing - gets removed. It turns into the same style as the text following it (“Pricing above should be orange”).
What we need to do is remove the contents of the bookmark entirely, and retain the style of the following text. In this case, we can “solve” the issue by including an extra line break before Pricing; unfortunately we can’t do that in some of our documents due to style guidelines.
Is there something we’re doing wrong that causes the style to change?
Thank you for your time.