I am working on fixing a code that was developed to delete rich text from the database, but when I try to run it to delete only indentations, it tends to delete other formatting things such as bullet points, numbers in table, and numbers in other attributes. How can I fix this so it only deletes the indentations?
Here are a couple things that I tried:
- I created a string that would read the object text of the current object it's being run through and used the following line of code in a cause where I wanted to get rid of indentations but keep bullets. I also looped this through a for richtext in string do. s = applyTextFormattingToParagraph(richText s, true, 0, 0) This code changed nothing with the outcome.
- I also tried using rich text properties inside the if statement of removing identations but keeping bullets to reapply the bullets after they have been removed and this has done nothing.
I don't have a working example, am not fluent with RTF and did not try the following. Just a wild guess: perhaps you have to iterate over each RTP of each RT of the string and apply the text formatting to each single paragraph that you want to change? Something like:
etc. etc. and finally set object text to the newString.