Drag Appointment/Meeting item to new date/time on Diary

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

Drag Appointment/Meeting item to new date/time on Diary
 
Martin Baud




Posts: 18
Joined: 2007-10-01
Are there any events I can hook into that i can add some additional processing if an Appointment/Meeting item is dragged to a new date/time on the Outlook Diary ?

Any help greatly received.
Posted 29 Feb, 2008 12:18:12 Top
Dmitry Kostochko


Add-in Express team


Posts: 2740
Joined: 2004-04-05
Hi Martin,

You can try to use the OnItemChange event of the Items collection:


  TAddInModule = class(TadxCOMAddInModule)
    procedure adxCOMAddInModuleAddInInitialize(Sender: TObject);
    procedure adxCOMAddInModuleAddInFinalize(Sender: TObject);
  private
    FItems: TItems;
    procedure DoItemChange(ASender: TObject; const Item: IDispatch);
  protected
  public
  end;

implementation

{$R *.dfm}

procedure TAddInModule.adxCOMAddInModuleAddInInitialize(Sender: TObject);
begin
  FItems := TItems.Create(nil);
  FItems.ConnectTo(OutlookApp.GetNamespace('MAPI').GetDefaultFolder(olFolderCalendar).Items);
  FItems.OnItemChange := DoItemChange;
end;

procedure TAddInModule.adxCOMAddInModuleAddInFinalize(Sender: TObject);
begin
  if Assigned(FItems) then
    FreeAndNil(FItems);
end;

procedure TAddInModule.DoItemChange(ASender: TObject; const Item: IDispatch);
var
  IAppointment: _AppointmentItem;
begin
  Item.QueryInterface(IID__AppointmentItem, IAppointment);
  if Assigned(IAppointment) then
    try
      //
      // TODO
      //
    finally
      IAppointment := nil;
    end;
end;



Posted 03 Mar, 2008 08:11:00 Top
Martin Baud




Posts: 18
Joined: 2007-10-01
Thanks. That's just what I need.
Posted 04 Mar, 2008 06:31:50 Top