OpenOffice-OODoc - Re: Delete-to-End of Document

Posted on Thu Oct 27 04:41:34 2005 by bob in response to 1171 (See the whole thread of 3)
Re: Delete-to-End of Document
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
Direct Responses: 1255 | Write a response