Outlook appointment item error

Add-in Express™ Support Service
That's what is more important than anything else

Outlook appointment item error
 
Kristjan H




Posts: 27
Joined: 2005-10-29
Hi

Defined following things as
VAR
itms:olevariant; ///->works but wont show object selector
itms2:appointmentitem; ///->doesnt work but shows object selector itms2.


i get error incompatible types IDispatch and _AppointmentItem

for that code: itms2:=calendar.Items.Add(olAppointmentItem);





Posted 02 Nov, 2005 16:47:36 Top
Dmitry Kostochko


Add-in Express team


Posts: 2752
Joined: 2004-04-05
Hi Kristjan,

Try the code below:

var
  Item: _AppointmentItem;
begin
  Item := Calendar.Items.Add(olAppointmentItem) as _AppointmentItem;
  try
    // ...
  finally
    Item := nil;
  end;
end;

Posted 03 Nov, 2005 07:05:41 Top
Kristjan H




Posts: 27
Joined: 2005-10-29
Thanks!
Posted 07 Nov, 2005 15:43:26 Top