in reply to "Type mismatch" Error While Using Win32:OLE for MS Outlook
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"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: "Type mismatch" Error While Using Win32:OLE for MS Outlook
by dushyant (Acolyte) on Jul 03, 2015 at 11:30 UTC | |
by Corion (Patriarch) on Jul 03, 2015 at 12:03 UTC | |
by dushyant (Acolyte) on Jul 03, 2015 at 12:31 UTC | |
by Corion (Patriarch) on Jul 03, 2015 at 12:56 UTC | |
by marto (Cardinal) on Jul 03, 2015 at 11:37 UTC | |
by UtherSRG (Initiate) on Apr 25, 2016 at 17:27 UTC |