Outlook Task Problem

Giganews Newsgroups
Subject: Outlook Task Problem
Posted by:  DominicM (dominic_mah…@msn.com)
Date: Wed, 4 Jul 2007

Newbie alert:
I get a "Method DueDate not supported by automation object, though VB.net
uses DueDate, so am confused, am using D2007 for win32

Can anyone help, did someone rename the field?

TIA Dominic

==CODE==
procedure TForm1.btnSaveIssueClick(Sender: TObject);
const
  olTaskItem = 0;
var
  Outlook,vTaskItem: OLEVariant;

begin
  with data.ADOTable2 do
  begin
      ...
  end;
  if CheckBox2.Checked then
  begin
  try
    Outlook := GetActiveOleObject('Outlook.Application');
    except
    Outlook := CreateOleObject('Outlook.Application');
  end;
  vTaskItem:=Outlook.CreateItem(olTaskItem);
  vTaskItem.Subject := edit5.text;
  vTaskItem.Body := Memo2.Text;
  vTaskItem.DateDue:=DateTimeToStr(DateTimePicker1.Date);
  vTaskItem.save;
  VarClear(Outlook);
  VarClear(vTaskItem);
  end;
end;

Replies