我已经设法在Outlook中添加了文件夹,但不知道如何移动它们。我的代码没有抛出任何警告,也没有移动文件夹:
#!/usr/bin/perl
use strict;
use warnings;
use Win32::OLE;
use Win32::OLE::Const 'Microsoft Outlook';
# use existing instance if Outlook is already running, or launch a new one
my $Outlook;
eval {$Outlook = Win32::OLE->GetActiveObject('Outlook.Application')};
die "Outlook not installed" if $@;
unless (defined $Outlook) {
$Outlook = Win32::OLE->new('Outlook.Application', sub {$_[0]->Quit;})
or die "Oops, cannot start Outlook";
}
my $namespace = $Outlook->GetNamespace("MAPI");
#my $Folder = $namespace->Folders("backupadmin")->Folders(
# "Inbox")->Folders->Add("test");
my $Folder = $namespace->Folders("backupadmin")->Folders(
"Inbox")->Folders("test")->MoveTo("test1"); 发布于 2015-03-21 13:55:02
如果使用流行的Outlook赎回库,则可以检索要移动的文件夹的RDO文件夹对象,然后使用目标RDO文件夹作为参数调用MoveTo方法。对于一些示例Perl代码,您可以参考RDO模块,该模块使用Win32::OLE和Outlook Redemption来访问Email::PST::Win32文件夹对象。
Outlook赎回:http://www.dimastr.com/redemption/home.htm
使用MoveTo方法的RDO文件夹:http://www.dimastr.com/redemption/rdo/rdofolder.htm
电子邮件::PST::win32:https://metacpan.org/release/Email-PST-Win32
https://stackoverflow.com/questions/24641343
复制相似问题