Shows how to create a task in Outlook as I did a super search earlier and this wasn't there. It doesn't handle the reminder time, recurrance or the more complicated bits but it does handle everything else.
use Win32::OLE; use strict; use warnings; # Note colours use constant olBlue => 0; use constant olGreen => 1; use constant olPink => 2; use constant olWhite => 4; use constant olYellow => 3; # General use constant olSave => 0; # Item types use constant olNoteItem => 5; use constant olTaskItem => 3; # Task priorities use constant olImportanceHigh => 2; use constant olImportanceLow => 0; use constant olImportanceNormal => 1; # Task status use constant olTaskComplete => 2; use constant olTaskDeferred => 4; use constant olTaskInProgress => 1; use constant olTaskNotStarted => 0; use constant olTaskWaiting => 3; # Note that the setting for the work values is in minutes. # 60 * 20 is 20 hours but that is 2x8 + 4 or 2 and a half # 8 hour days. # To enter a complete task change the entry to True my $options = { 'MessageClass' => "IPM.Task", 'Body' => "Test task", 'Importance' => olImportanceHigh, 'Subject' => "This is a task that you should do fool", 'DueDate' => "01/03/2002", 'StartDate' => "01/03/2002", 'TotalWork' => 60 * 20, 'ActualWork' => 60, 'Companies' => "Bodgit and Scarper", 'Complete' => "False", 'PercentComplete' => 24, 'Status' => olTaskInProgress, 'Mileage' => "Loads, its a good runner", 'BillingInformation' => "Cost center 101", 'ReminderSet' => "True", 'ReminderPlaySound' => "True", 'ReminderSoundFile' => "reminder.wav", 'ReminderTime' => "01/03/2002", }; my $Outlook = Win32::OLE->GetActiveObject('Outlook.Application'); # Create a task my $task = $Outlook->CreateItem(olTaskItem); # Write Note Title & Body while (my ($key,$val) = each %{$options}) { $task->{$key} = $val; } # Close and Save note. $task->Close(olSave);

In reply to Add a task to Outlook 2000 by simon.proctor

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.