Thanks guys, and humble apologies for being such a nugget. I had my personal options for set to the default of three levels, so I couldn't see that you had replied. It's sorted now, so am off and running again. duh!
I had already managed to get a list of the folders at the top level using code similar to what you suggested namely
my $Folder = $namespace->Folders("Personal Folders");
my $Items = $Folder->Items;
my $sheetcnt = $namespace->Folders->Count();
foreach (1..$sheetcnt){
$Folder = $namespace->Folders($_)->{Name};
print "\t" .$Folder ."\n";
# my $subfolder = $namespace->Folders($Folder)->MAPIFolder->Count();
# foreach (1..$subfolder){
# print "\t" .$namespace->Folders($Folder)->MAPIFolder($_)->{Name
+}. "\n";
# }
}
The commented out lines are my attempt to get to the next level down, which should be the list of folders, including inbox, outbox, calendar etc. etc. however if the commented out code is reinstated, it fails. with 'Can't call method "Count" on an undefined value at .......' which is the line
my $subfolder = $namespace->Folders($Folder)->MAPIFolder->Count();
Having checked the Outlook Object Model from the reference helpfully supplied by this site, MAPIFolder does seem to be the next level down, so I am not sure where I am going wrong.
Any ideas?