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

In the PowerPoint.pm module built on WIN32:OLE I'm trying to affect an msoShapeArc object - namely the two adjustable items which set the start angle and the extent of the arc.

Here's the code I've tried ... commented out

# Set the start and extent angles of an arc # $new_shape->{Adjustments}{Item}=($options->{start}, $options->{ex +tent}); # $new_shape->{Adjustments}{Item}[0]=$options->{start}; # $new_shape->{Adjustments}{Item}[1]=$options->{extent}; # $new_shape->{Adjustments}{Item}[1]=$options->{start}; # $new_shape->{Adjustments}{Item}[2]=$options->{extent}; # $new_shape->Item=$options->{start}; # $new_shape->Item=$options->{extent};
It would appear to have to do with the syntax for accessing an Adjustment Item as described in the MicroSoft VBA documentation here:

https://learn.microsoft.com/en-us/office/vba/api/powerpoint.adjustments

Last time I got some great help about Variant ... but I can't find any documentation on how to use the Item.

Thanks for any help!

Replies are listed 'Best First'.
Re: Another Win32::OLE question about Item
by Corion (Patriarch) on Jun 15, 2023 at 07:10 UTC

    The .Item function is the way to access a list-like property in VBA. So it doesn't really make sense to try to assign to ->Item. Your first lines use the Adjustments object like the documentation does, but I don't see anything in the documentation that suggests usage like the last two lines.

Re: Another Win32::OLE question about Item
by NetWallah (Canon) on Jun 15, 2023 at 16:06 UTC
    You may need a ShapeRange attribute before you can get the Adjustments.

    This is just a guess, based on this posting (Excel Forum : Drawing Arcs).

                    "These opinions are my own, though for a small fee they be yours too."

      Thanks for the idea.

      There is a page for the Shape.Adjustment property here: https://learn.microsoft.com/en-us/office/vba/api/powerpoint.shape.adjustments and this finally worked:

      # If shape is a msoShapeArc if($shape =~ /msoShapeArc/i) { # Set the start and extent angles of an arc $new_shape->{Adjustments}{1}=$options->{start}; $new_shape->{Adjustments}{2}=$options->{extent};
      I was using a perl list reference of a 1 in square brackets when it was just another hash key deeper like {1} and then it WORKED!!!

      Thanks to you both for assisting - having someone to bounce an idea off of helps!