appointment open event

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

appointment open event
 
Kristjan H




Posts: 27
Joined: 2005-10-29
hi

does anybody know how to hook appoinment onopen event or smth? i could not find similar event like in word DoDocumentOpen..

i need to read some user properties before that and show these to custom combo box.

thanks

Kris
Posted 12 Oct, 2006 16:28:55 Top
Fedor Shihantsov


Guest


See the Inspectors.NewInspector event.
Posted 13 Oct, 2006 02:43:33 Top
Dmitry Kostochko


Add-in Express team


Posts: 2875
Joined: 2004-04-05
Hi Kris,

You can use the OnOLNewInspector event for connecting to the Inspector.CurrentItem interface. See the pseudo code below:


procedure TAddInModule.adxCOMAddInModuleOLNewInspector(ASender: TObject;
  const Inspector: _Inspector);
var
  IMail: _MailItem;
begin
  if Assigned(FItem) then FreeAndNil(FItem);
  Inspector.CurrentItem.QueryInterface(IID__MailItem, IMail);
  if Assigned(IMail) then
    try
      FItem := TMailItem.Create(nil);
      FItem.ConnectTo(IMail);
      FItem.OnOpen := DoOpen;
    finally
      IMail := nil;
    end;
end;

procedure TAddInModule.adxCOMAddInModuleOLInspectorClose(Sender: TObject);
begin
  if Assigned(FItem) then FreeAndNil(FItem);
end;

procedure TAddInModule.DoOpen(ASender: TObject; var Cancel: WordBool);
begin
  // TODO
end;



Posted 16 Oct, 2006 06:11:27 Top