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?
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.