Hi PerlMonks, I have found this site very useful. I am trying to automate the power point using Win32::PowerPoint. I have written the following code, but it is giving problems. Code is:
use Win32::PowerPoint; # Global var(s) my $file = "E:\\rameshwar\\dedupe\\test_presentation.pptx"; # create construtor for ppt App and if script dies #un-expectedly then + quit the App my $ppt_ref = Win32::PowerPoint->new || die("Opps, failed to open PPT + App", Win32::OLE::LastError()); # Make it visible by setting property Visible to 1:: if set 0 it is in +visible $ppt_ref->{Visible} = 1; # set presentation-wide information $ppt_ref->new_presentation( background_forecolor => [255,255,255], background_backcolor => 'RGB(0, 0, 0)', pattern => 'Shingle', ); # and master footer if you prefer (optional) $ppt_ref->set_master_footer( visible => 1, text => 'My Slides', slide_number => 1, datetime => 1, datetime_format => 'MMMMyy', ); # do whatever you want to do for each of your slides my @slides; for my $slide (@slides) { # my $slide = $ppt_ref->new_slide; $ppt_ref->add_text($slide->title, { size => 40, bold => 1 }); $ppt_ref->add_text($slide->body_text); $ppt_ref->add_text($slide->link, { link => $slide->link }); } $ppt_ref->save_presentation($file); $ppt_ref->close_presentation;
In the for loop above what are the values for @slides, how that array is populated? I thought it if obj reference to $ppt_ref->new_slide my $slide = $ppt_ref->new_slide; But looks like it is not the case. Please guide me on this. Thanks. Proton-69

In reply to Win32::PowerPoint to create slides by proton-69

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.