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


In reply to Win32::PowerPoint extension by EnzoXenon

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.