|
Works for me:
my $delete_rest;
my @paragraphs=$content->getParagraphList();
#need to save the first few in order to preserve headers and footers
@paras=@paragraphs[4..$#paragraphs];
for my $para (@paragraphs) {
my $text= $content->getText($para);
$delete_rest++ if $text=~/DELETE TO END/;
next unless $delete_rest;
$content->removeParagraph($para);
}
$content->save
|