Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: Outlook & Win32::OLE

by maa (Pilgrim)
on Aug 17, 2004 at 11:53 UTC ( #383625=note: print w/replies, xml ) Need Help??


in reply to Outlook & Win32::OLE

Example code for accessing a "shared mailbox subfolder"...

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 } }

HTH - Mark

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://383625]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (3)
As of 2023-05-31 17:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?