Re: XWPF Remove Paragraph from TextBox

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Re: XWPF Remove Paragraph from TextBox

W Kingt


Hi, I'm using this code to clear the TextBox.

public static void clearTextShape(TextShape<?, ?> shape) {
    if (shape instanceof XSLFTextShape) {
        ((XSLFTextShape) shape).clearText();
    } else {
        List<?> paragraphs = shape.getTextParagraphs();
        paragraphs.clear();
    }
}



P.S. This is from none official


On 2019/12/22 02:28:03, Nathan Motter <[hidden email]<mailto:[hidden email]>> wrote:

> I have been struggling to remove a paragraph from a text box.  Could someone provide and example?  Use Case: I am looping through a text box looking for particular text.  Once I identify the text I want to remove the entire paragraph.  Thanks for any help you can provide. >

>

> --------------------------------------------------------------------->

> To unsubscribe, e-mail: [hidden email]<mailto:[hidden email]>>

> For additional commands, e-mail: [hidden email]<mailto:[hidden email]>>

>

>