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 |
|
Fedor Shihantsov
Guest
|
See the Inspectors.NewInspector event. |
|
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;
|
|