Okay, I misunderstood what you were trying to accomplish with the if statements initially and I apologize.
Try moving the variable declarations outside of the if statements.
#!/perl/bin/perl use strict; use warnings; use Win32::OLE; use Win32::OLE::Variant; #Needed for ReceivedTime constant. my $Outlook = Win32::OLE->new('Outlook.Application'); my $namespace = $Outlook->GetNameSpace("MAPI"); my $recipient = $namespace->CreateRecipient("inboxname"); if ($recipient) { print "OK\n"; } else { print "$!\n"; } $recipient->Resolve; # see url if ($recipient->Resolved) { print "Resolved\n"; } else { print "$!, unable to resolve\n"; } my $p2 = $namespace->GetSharedDefaultFolder($recipient,6); # what does + this return? if ($p2) { print "OK2\n"; } else { print "$!, Code fails here, does not return an error\n"; }
(Untested)
See also GetSharedDefaultFolder
In reply to Re: MS Outlook GetSharedDefaultFolder
by Mr. Muskrat
in thread MS Outlook GetSharedDefaultFolder
by Mitch
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |