* # Count a attachments* *my* $AttachmentNb = $message->Attachments()->Count(); *# Create attachments filename list * *my* $AttachmentsList; *if*($AttachmentNb > 0){ *for* (*my* $i=1;$i <= $AttachmentNb;$i++){ *# Add attachment filename to the list * $AttachmentsList .= $message->Attachments()->Item($i)->FileName()."\r\n" ; *# Save attachement as its filename in path of your choice [ c:\ in this example ]* $message->Attachments()->Item($i)->SaveAsFile( 'c:\\'.$message->Attachments()->Item($i*)->*FileName()); } }
---------------- Benoit Quenneville ---------------- FW: How to save the attachment in Microsoft outlook using perl-code Yekhande, Seema \(MLITS\) Thu, 01 Jun 2006 00:55:20 -0700 Title: FW: How to save the attachment in Microsoft outlook using perl-code Dear All, I am writing following code to read the latest message in Microsoft outlook. But does anyone knows how to write a code to download the attachment with name given. Please tell me how to save the attachment in particular folder with given name using perl. # create the object use Mail::Outlook; my $outlook = new Mail::Outlook(); # start with a folder my $outlook = new Mail::Outlook('Inbox'); # use the Win32::OLE::Const definitions use Mail::Outlook; use Win32::OLE::Const 'Microsoft Outlook'; my $outlook = new Mail::Outlook(olInbox); # get/set the current folder my $folder = $outlook->folder(); my $folder = $outlook->folder('Inbox'); # get the first/last/next/previous message my $message = $folder->first(); # read the attributes of the current message my $text = $message->From(); $text .= $message->To(); $text .= $message->Cc(); $text .= $message->Bcc(); $text1 = $message->Subject(); $text2 = $message->Body(); print "==$text==$text1==$text2===\n"; Thanks, Seema.
_______________________________________________ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs