Or you can use the in() function from Win32::OLE, which will enumerate all objects within a container
use Win32::OLE qw(in); foreach my $obj_Story(in($newdoc->StoryRanges)){ -----Original Message----- From: Ichim, Adrian N. [mailto:[EMAIL PROTECTED] Sent: Monday, June 14, 2004 12:12 AM To: [EMAIL PROTECTED] Subject: RE: Microsoft Word and Perl Could you try instead foreach my $obj_Story (@{$newdoc->StoryRanges}) { ..... ....... } As I remember from my past experience with Win32::OLE stuff, Perl doesn't know that $newdoc->StoryRanges is a list, therefore you need to be more explicit. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>