On this machine I don't have any sub folders within my inbox. Note the Win32::OLE::Const line and the difference in GetDefaultFolder(olFolderInbox). A short example:
#!/usr/bin/perl use strict; use warnings; use Win32::OLE; use Win32::OLE::Const 'Microsoft Outlook'; my $Outlook = Win32::OLE->GetActiveObject('Outlook.Application'); my $NameSpace = $Outlook->GetNameSpace("MAPI"); my $Folder = $NameSpace->GetDefaultFolder(olFolderInbox); # print subject for each item for (my $i = 1; $i <= $Folder->Items->Count; $i++) { print $Folder->Items->Item($i)->Subject . "\n"; }
In reply to Re: "Type mismatch" Error While Using Win32:OLE for MS Outlook
by marto
in thread "Type mismatch" Error While Using Win32:OLE for MS Outlook
by dushyant
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |