In PowerPoint.pm extension to Win32::OLE I added a routine to create a line in a PowerPoint - like this it works!
sub add_line { my ($self, $options) = @_; return unless $self->slide; $options = {} unless ref $options eq 'HASH'; my $new_line = $self->slide->Shapes->AddLine($options->{x1}, $option +s->{y1}, $options->{x2}, $options->{y2}); $new_line->{Line}{ForeColor}{RGB}=RGB($options->{forecolor}) if(defi +ned $options->{forecolor}); $new_line->{Line}{Weight}=$options->{weight} if(defined $options->{w +eight}); $new_line->{Line}{Pattern}=$options->{pattern} if(defined $options-> +{pattern}); return $new_line; }
Now I'm trying to add a routine to make a polyline ... (so I can draw arbitrary and not just mso Shapes) and I coded it like this:
sub add_polyline { my ($self, $options) = @_; return unless $self->slide; $options = {} unless ref $options eq 'HASH'; my $new_poly=$self->slide->Shapes->AddPolyline($options->{points}); $new_poly->{Line}{ForeColor}{RGB}=RGB($options->{forecolor}) if(defi +ned $options->{forecolor}); $new_poly->{Line}{Weight}=$options->{weight} if(defined $options->{w +eight}); $new_poly->{Line}{Pattern}=$options->{pattern} if(defined $options-> +{pattern}); if(defined $options->{fillcolor}) { $new_poly->{Fill}{ForeColor}{RGB}=RGB($options->{fillcolor}); } else { $new_poly->{Fill}{Transparency}=1; } return $new_poly; }
Which does not work. The argument needed by the microsoft routine AddPolyline is something called a "SafeArrayOfPoints" in the docos.

https://documentation.help/Microsoft-PowerPoint-Visual-Basic/ppmthAddPolyline1.htm

I've tried an array, a two-dimensional array, and array reference ... nothing works.

Can anyone help?


In reply to PowerPoint.pm extension for AddPolyline not working 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.