in reply to PowerPoint.pm extension for AddPolyline not working
According to the Microsoft documentation for AddPolyline, the method takes a Variant datatype. Without testing, you should be able to create a (2-dimensional) Variant that contains an array (of integers) like this:
use Win32::OLE; use Win32::OLE::Variant; my $pointcount = 4; # 4 points my $point_dimensions = 2; # The arrayrefs mean we use 1-based indices, like the VBA examples do: # my $pointlist = Variant(VT_ARRAY | VT_R4 , [1,$pointcount], [1,$poin +t_dimensions]); # Alternatively, use 0-based indices, like Perl does: my $pointlist = Variant(VT_ARRAY | VT_R4 , $pointcount, $point_dimensi +ons); $pointlist->Put( 0,0, 25 ); $pointlist->Put( 0,1, 100 ); ... $slide->Shapes->AddPolyline($pointlist);
The MS documentation suggests that the SafeArryOfPoints should be a 2-dimensional array.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: PowerPoint.pm extension for AddPolyline not working
by EnzoXenon (Acolyte) on Jun 14, 2023 at 12:15 UTC |