Недавно добавленные исходники

•  DeLiKaTeS Tetris (Тетрис)  3 670

•  TDictionary Custom Sort  5 800

•  Fast Watermark Sources  5 603

•  3D Designer  8 218

•  Sik Screen Capture  5 913

•  Patch Maker  6 388

•  Айболит (remote control)  6 378

•  ListBox Drag & Drop  5 237

•  Доска для игры Реверси  94 551

•  Графические эффекты  6 570

•  Рисование по маске  5 644

•  Перетаскивание изображений  4 760

•  Canvas Drawing  5 135

•  Рисование Луны  4 863

•  Поворот изображения  4 411

•  Рисование стержней  3 116

•  Paint on Shape  2 360

•  Генератор кроссвордов  3 228

•  Головоломка Paletto  2 551

•  Теорема Монжа об окружностях  3 328

•  Пазл Numbrix  2 200

•  Заборы и коммивояжеры  2 849

•  Игра HIP  1 820

•  Игра Go (Го)  1 740

•  Симулятор лифта  2 072

•  Программа укладки плитки  1 798

•  Генератор лабиринта  2 240

•  Проверка числового ввода  1 925

•  HEX View  2 226

•  Физический маятник  1 911

 
скрыть

  Форум  

Delphi FAQ - Часто задаваемые вопросы

| Базы данных | Графика и Игры | Интернет и Сети | Компоненты и Классы | Мультимедиа |
| ОС и Железо | Программа и Интерфейс | Рабочий стол | Синтаксис | Технологии | Файловая система |



Delphi Sources

Как написать Outlook AddIn



{
  1.  Create an ActiveX-Library
  Save the project as e.g. "OLAddIn.dpr"

  2.Create an automation object
  Call the CoClass e.g. "AddIn"
  Save the Unit as "AddIn.pas"

  3.  Add to the uses clause
  - AddInDesignerObjects_TLB
  - Outlook_TLB

}



 procedure OnConnection(const Application: IDispatch; ConnectMode: ext_ConnectMode;
   const AddInInst: IDispatch; var custom: PSafeArray); safecall;
 procedure OnDisconnection(RemoveMode: ext_DisconnectMode; var custom:
   PSafeArray); safecall;
 procedure OnAddInsUpdate(var custom: PSafeArray); safecall;
 procedure OnStartupComplete(var custom: PSafeArray); safecall;
 procedure OnBeginShutdown(var custom: PSafeArray); safecall;

{  
  and complete the class by pressing Ctrl-Shft-C  

  4. Step  
  Register the COM-object with "run / register ActiveX Server"  
  Register the AddIn, so that the Addin will be recognized by Outlook  
  - Create a new key: HKEY_CURRENT_USER\Software\Microsoft\Office\Outlook\Addins\OLAddIn.AddIn  
  - create a DWOrd "LoadBehavior" with the value 3  

  5. 
  Compile the AddIn  
  Start Outllok  

  Sourcecode  

  *********************************************************************************  
}

library OLAddIn;

uses
  ComServ,
  OLAddIn_TLB in 'OLAddIn_TLB.pas',
  AddIn in 'AddIn.pas' {AddIn: CoClass};

exports
  DllGetClassObject,
  DllCanUnloadNow,
  DllRegisterServer,
  DllUnregisterServer;

{$R *.TLB}

{$R *.RES}

begin
end.

{
**********************************************************
**********************************************************
}

unit AddIn;

{$WARN SYMBOL_PLATFORM OFF}

interface

uses
  ComObj, ActiveX, OLAddIn_TLB, StdVcl, AddinDesignerObjects_TLB, Outlook_TLB;

type
  TAddIn = class(TAutoObject, IAddIn, IDTExtensibility2)
  protected
    { Protected declarations }
    procedure OnConnection(const Application: IDispatch; ConnectMode:
      ext_ConnectMode;
      const AddInInst: IDispatch; var custom: PSafeArray); safecall;
    procedure OnDisconnection(RemoveMode: ext_DisconnectMode; var custom:
      PSafeArray); safecall;
    procedure OnAddInsUpdate(var custom: PSafeArray); safecall;
    procedure OnStartupComplete(var custom: PSafeArray); safecall;
    procedure OnBeginShutdown(var custom: PSafeArray); safecall;
  end;

implementation

uses ComServ, Dialogs;

{ TAddIn }

procedure TAddIn.OnAddInsUpdate(var custom: PSafeArray);
begin

end;

procedure TAddIn.OnBeginShutdown(var custom: PSafeArray);
begin

end;

procedure TAddIn.OnConnection(const Application: IDispatch;
  ConnectMode: ext_ConnectMode; const AddInInst: IDispatch;
  var custom: PSafeArray);
begin
  // To show, that the AddIn has started just say anything
  ShowMessage('Das AddIn wurde gestartet');
end;

procedure TAddIn.OnDisconnection(RemoveMode: ext_DisconnectMode;
  var custom: PSafeArray);
begin

end;

procedure TAddIn.OnStartupComplete(var custom: PSafeArray);
begin

end;

initialization
  TAutoObjectFactory.Create(ComServer, TAddIn, Class_AddIn,
    ciMultiInstance, tmApartment);
end.







Copyright © 2004-2025 "Delphi Sources" by BrokenByte Software. Delphi World FAQ

Группа ВКонтакте