Skip Menu |

This queue is for tickets about the Mail-Outlook CPAN distribution.

Report information
The Basics
Id: 27531
Status: resolved
Priority: 0/
Queue: Mail-Outlook

People
Owner: Nobody in particular
Requestors: jquelin [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Wishlist
Broken in: (no value)
Fixed in: (no value)



Subject: get list of all mail folders known by outlook
the attached patch adds a method all_folders() to Mail::Outlook to get the list of all MAPI folders. would you consider including it to mail::outlook?
Subject: mail-outlook-all_folders.patch
--- Outlook-old.pm 2007-06-11 16:02:39.926263700 +0200 +++ Outlook.pm 2007-06-11 16:08:42.323511000 +0200 @@ -162,6 +162,22 @@ Win32::OLE->FreeUnusedLibraries(); } +=head2 all_folders() + +Get the list of all open mail folders in Outlook + +=cut + +sub all_folders { + my ($self) = @_; + my $folders = $self->{namespace}->Folders; + my @folders; + push @folders, $folders->Item($_)->Name + for 1 .. $folders->Count; + return @folders; +} + + =head2 folder() Gets or sets the current folder object.
From: denisputnam [...] verizon.net
On Mon Jun 11 10:15:01 2007, JQUELIN wrote: Show quoted text
> the attached patch adds a method all_folders() to Mail::Outlook to get > the list of all MAPI folders. > > would you consider including it to mail::outlook?
Dear Jquelin, Would it be possible to get a copy of the file that you originally submitted for this? It appears to be truncated and it would be a great help to me if I could look at your code. I need to what methods are available in Mail::Outlook or the Win32. Thank you so much. Sincerely, Denis Putnam
well, the patch is complete (i just tried to download it and it worked well). however, i now think that it may not be the best way to proceed. i think that mail::outlook::message and mail::outlook::folder should be ole objects, only holding pointer to proxy (ole) allowing to retrieve data. but this goes far beyond my patch, and i don't know whether barbie wants to go down that way... ==> barbie, what are your plans regarding this module?
Hi Jerome, Thanks for the patch. I'll review it this week and let you know whether it's accept it. On the face of it, I don't see any reason why not, but I need to make sure it works with the Outlook applications I have. Show quoted text
> however, i now think that it may not be the best way to proceed. > i think that mail::outlook::message and mail::outlook::folder should > be ole objects, only holding pointer to proxy (ole) allowing to > retrieve data.
Their not straightforward OLE objects as they both do a little extra. In the case of Folder.pm, it allows you to pass different formats for the folder you require and does the hard work behind the scenes to pass it to the OLE object correctly and simplifies some of the calls. Message.pm also simplifies some of the functionality from the OLE object. Message.pm does provide AUTOLOAD access to the OLE directly, but at the moment this is restricted to known accessors. The reason for this is to prevent bad calls from crashing the application. The OLE object is very fragile and even eval blocks don't help :( If there are specific calls you wanted access to I can add them to the autosubs list for messages, and perhaps look into adding a similar feature for folders if necessary. Regards, Barbie.
Patched in 0.14. Apologies for taking so long over this :(