Making Outlook Talk To Perl: Part Two: Perl Side |
|
March 23, 2008 |
The following Perl script is called by the Outlook macro in the previous post Making Outlook talk to Perl: Part one: VBA side. It takes all the attachments from the mail and puts them in a directory on the desktop.
; exit;}# Print an error message, and die if the second argument is true.sub err{ my ($errmsg, $quit) = @_; print $errmsg, “\n”; wait_quit if ($quit);}my $subject;my $job_number;if (@ARGV) { $subject = join (’ ‘, @ARGV); if ($subject =~ /\(Job:(\d+)\)/) {$job_number = $1; } else {err (”The current mail subject $subject is not \”Job\”.”,1); }} else { err (”No command line given. Quitting!”, 1);}# Connect to Outlook.my $Outlook = || ‘Quit’) or err “Could not connect to outlook”, 1;# The currently selected message.my $message = Check that the command line and the Outlook mail have the same subjects.if ($message) { my $msubject = $message->Subject; if ($msubject ne $subject) {my $moan=<



March 23, 2008
Leave a Reply