#!C:/ActivePerl/bin/perl.exe use strict; use warnings; use Win32::OLE; #Tset case - I know the app is running... my $Outlook = Win32::OLE->GetActiveObject("Outlook.Application"); my ($MAPI,$Inbox,$TestFolder,$Message,$bodytext,$newtext); $MAPI=$Outlook->GetNameSpace("MAPI"); $Inbox=$MAPI->GetDefaultFolder(6); $TestFolder=$Inbox->Folders("Perlmonks"); print "There are " . $TestFolder->{Items}->{Count} . " items in the inbox.\n\n"; for my $x (1) { $bodytext = $TestFolder->Items($x)->Body; print "Message Subject:\n" . $TestFolder->Items($x)->Subject . "\n"; print "Body Text:\n$bodytext\n"; print "Replacing entire body with \"foo bar\"\n\n"; $TestFolder->Items($x)->{'Body'} = "foo bar"; #Doesn't work.. $TestFolder->Items($x)->LetProperty('Body',"foo bar") ; #Does't work.. $TestFolder->Items($x)->Save; #Doesn't make a difference! print "Body is now supposedly:\n\n" .$TestFolder->Items($x)->Body . "\n"; #Hasn't updated! my $NewItem = $TestFolder->Items($x)->Copy; #Works fine } #### '..snip... For Each M In objInbox.Items Text = Text & M.Subject & vbCr x=x+1 M.Body= "foo bar" 'Assignment msgbox M.Body 'Works perfectly M.Save Next '..snip...