in reply to Query an object in Perl using Win32::OLE

VB hides a lot of the true complexity of OLE, because MS has spent the development effort to do so.

You need to look at Win32::OLE::Enum, since you seem to be working with collections. Handling collections is also covered in the Win32::OLE POD under Functions.

This code is untested, but I would try:

use Win32; use Win32::OLE; use Win32::OLE::Enum; # louder errors Win32::OLE->Option(Warn => 3); ... my $Enum = Win32::OLE::Enum->new($Recipe->Placements); while (defined(my $placement = $Enum->Next)) { Win32::MsgBox($placement->PlacementPart->{Refdes}); } # - or - use Win32::OLE qw/ in /; for my $placement (in $Recipe->Placements) { Win32::MsgBox($placement->PlacementPart->{Refdes}); }

--Solo
--
You said you wanted to be around when I made a mistake; well, this could be it, sweetheart.

Replies are listed 'Best First'.
Re: Re: Query an object in Perl using Win32::OLE
by juo (Curate) on May 25, 2004 at 13:51 UTC
    Thank you very much Solo for the documentation links and sample code. This is the headstart I needed. Your sample code works fine also. Pieter