http://www.perlmonks.org?node_id=11152310

EnzoXenon has asked for the wisdom of the Perl Monks concerning the following question:

I'm attempting to extend the Win32::PowerPoint module to alter the size of a page in PowerPoint.

In the Constants.pm module I've added the following to define the page names to the enumeration from the Microsoft documentation

ppSlideSize35MM => 4, ppSlideSizeA3Paper => 9, ppSlideSizeA4Paper => 3, ppSlideSizeB4ISOPaper => 10, ppSlideSizeB4JISPaper => 12, ppSlideSizeB5ISOPaper => 11, ppSlideSizeB5JISPaper => 13, ppSlideSizeBanner => 6, ppSlideSizeCustom => 7, ppSlideSizeHagakiCard => 14, ppSlideSizeLedgerPaper => 8, ppSlideSizeLetterPaper => 2, ppSlideSizeOnScreen => 1, ppSlideSizeOverhead => 5,

In the PowerPoint.pm module I've added a method to alter the page setup like this

sub page_setup { my ($self, $options) = @_; $options = {} unless ref $options eq 'HASH'; $self->presentation->PageSetup->SlideSize($options->{slidesize}); $self->presentation->PageSetup->SlideWidth($options->{width}); $self->presentation->PageSetup->SlideHeight($options->{height}); }

In my call to this function I try to set the slide size with no luck

# Set the slide size $PPT->page_setup( { slidesize => 'ppSlideSizeLetterPaper', width => 11*72, height => 8.5*72 } );

When I debug the code and print out the slide information ... from within PowerPoint.pm from this code

print "\nPowerPoint.pm(): slide size=" . $self->presentation->PageSetu +p->SlideSize . "\n"; print "PowerPoint.pm(): width=" . $self->presentation->PageSetup->Sl +ideWidth . "\n"; print "PowerPoint.pm(): height=" . $self->presentation->PageSetup->Sl +ideHeight . "\n\n";

I list out the options called (they seem to be right) and get the answers like this

PowerPoint.pm(): options: slidesize=ppSlideSizeLetterPaper height=612 width=792 PowerPoint.pm(): slide size=7 PowerPoint.pm(): width=960 PowerPoint.pm(): height=540
So, I can properly read the current values but I can't set new ones. Any wisdom would be greatly apprecaited.

Your humble apprentice formerly registered as nzsvz9 but can't find or fix his login so newly creating this EnzoXenon account