Leser: 3
|< 1 2 >| | 18 Einträge, 2 Seiten |
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
use strict;
use warnings;
use Win32::OLE::Const 'Microsoft Outlook';
use Win32::OLE 'in';
#Code for Outlook 97
my $FolderName = "my shared folder";
my $strValidUser = "~ DSM Requests"; #mailbox name/alias
my $Outlook = Win32::OLE->GetActiveObject("Outlook.Application");
unless(defined($Outlook)){
die("Unable to obtain Outlook OLE handle $!\n");
}
my $objNS = $Outlook->GetNamespace("MAPI");
my $objRecipient = $objNS->CreateRecipient($strValidUser);
$objRecipient->Resolve(); #You should check this!
my $objInbox = $objNS->GetSharedDefaultFolder($objRecipient, olFolder
+Inbox);
my $objFolder = $objInbox->Folders($FolderName);
foreach my $email (in $objFolder->Items ){
if ($email->{UnRead} == 0) {
#blah blah
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/usr/bin/perl
use warnings;
use strict;
use Win32::OLE;
use Win32::OLE::Const 'Microsoft Outlook';
my $msOutlook = Win32::OLE->new('Outlook.Application') or die $!;
my $nameSpace = $msOutlook->GetNamespace("MAPI");
my $folder = $nameSpace->GetDefaultFolder(olFolderInbox);
my $items = $folder->Items;
for my $itemIndex(1..$items->Count) {
my $message = $items->Item($itemIndex);
$message = $items->Item($itemIndex)->{UnRead}; # DAS HIER STIMMT NICHT
} # for
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/usr/bin/perl
use warnings;
use strict;
use Win32::OLE;
use Win32::OLE::Const 'Microsoft Outlook';
my $msOutlook = Win32::OLE->new('Outlook.Application') or die $!;
my $nameSpace = $msOutlook->GetNamespace("MAPI");
my $folder = $nameSpace->GetDefaultFolder(olFolderInbox);
my $items = $folder->Items;
for my $itemIndex(1..$items->Count) {
my $message = $items->Item($itemIndex);
$message->{'UnRead'} = "False"; # $message->{'UnRead'} = "True"; ist das Gegenteil, also nicht 'Read' oder sonst etwas
} # for
my $folder = $nameSpace->GetDefaultFolder(olFolderInbox);
|< 1 2 >| | 18 Einträge, 2 Seiten |