Deal with different shape types with if/else statements. (You can use the object browser to inspect the msoShapeType constant values)
pojsub scan { my $file = shift; print "Scanning $file\n"; my $p = $ppt->Presentations->Open($file); my $slides = Win32::OLE::Enum->new( $p->Slides ); my $slide = $slides->Next; my $shapes = Win32::OLE::Enum->new( $slide->Shapes ); while ( my $shape = $shapes->Next ){ my $stype = $shape->type; print "Shape type is $stype\n"; if ($stype == 17){ my $text = $shape->TextFrame->TextRange->text; print "TextBox is $text\n"; } elsif ($stype == 14){ my $type = $shape->PlaceholderFormat->Type; if ( $type == ppPlaceholderTitle or $type == ppPlaceholderCenterTitle or $type == ppPlaceholderVerticalTitle ){ my $title = $shape->TextFrame->TextRange->text; print "Title is $title\n"; } } } }
In reply to Re^3: Error in Extracting Data from the 1st slide of a ppt
by poj
in thread Error in Extracting Data from the 1st slide of a ppt
by mehtav
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |