gives error: Undefined subroutine &main::getFrameElement called at C:\scripts\test1.pl line 10. what is wrong ?use strict; use OpenOffice::OODoc; use OpenOffice::OODoc::Meta; use OpenOffice::OODoc::XPath ; use OpenOffice::OODoc::Image; &test; sub test { my $doc = ooDocument(file => "C:\\macros\\OOSjablonen\\test.odt") ; my $element = getFrameElement('frame_name'); print "el: $element text:\n"; }
gives: Use of uninitialized value $element in concatenation (.) or string at C:\scripts\test1.pl line 11.use strict; use OpenOffice::OODoc; use OpenOffice::OODoc::Meta; use OpenOffice::OODoc::XPath ; use OpenOffice::OODoc::Image; &test; sub test { my $doc = ooDocument(file => "C:\\macros\\OOSjablonen\\test.odt") ; my $element = OpenOffice::OODoc::XPath::getFrameElement('frame_name'); print "el: $element text:\n"; }
thks for giving me a answersub getFrameElement { my $self = shift; my $frame = shift; return undef unless defined $frame; my $tag = shift || 'draw:frame'; my $element = undef; if (ref $frame) { $element = $frame; } else { if ($frame =~ /^[\-0-9]*$/) { return $self->getElement("//$tag", $frame, @_); } else { return $self->selectFrameElementByName ($frame, $tag, @_); } } }
In reply to OpenOffice::OODoc I need to add text into a frame by harryC
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |