#!perl use warnings; use strict; use Win32::OLE; use Win32::OLE::Const 'Microsoft Outlook'; use Getopt::Long; =pod This reads the note contents from <>, so you can type into it or pipe into it from another program, for example. The Subject is calculated from the Body - specifically, it is taken from the first line of the Body, at the time the Save operation is performed. A NoteItem contains the following properties (not all of which are settable): Application Class Session Parent Body Categories Color CreationTime EntryID GetInspector Height LastModificationTime Left MessageClass Saved Size Subject Top Width Links DownloadState ItemProperties MarkForDownload IsConflict Colors are enumerated as follows: 0 Blue 1 Green 2 Pink 3 Yellow 4 White =cut my @colors = qw( blue green pink yellow white ); my %colors; @colors{@colors} = (0 .. $#colors); my $color; GetOptions( 'color=s' => \$color ); my $ol = Win32::OLE->new('Outlook.Application') or die "Unable to create an Outlook context: $!\n"; my $noteitem = $ol->CreateItem( olNoteItem ) or die "Unable to create a new Note: $!\n"; undef $/; $noteitem->{'Body'} = <>; # sluurp if ( defined $color ) { my $i = $colors{lc $color}; defined $i and $noteitem->{'Color'} = $i; } $noteitem->Save;